Fix a crash

This commit is contained in:
Thomas 2023-01-26 18:16:26 +01:00
parent 90a6a6ceaa
commit e4affdc9d7
2 changed files with 9 additions and 4 deletions

View File

@ -154,6 +154,7 @@
android:id="@+id/nav_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:labelVisibilityMode="unlabeled"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
app:layout_constraintBottom_toBottomOf="parent"

View File

@ -158,15 +158,19 @@ public class BasePeertubeActivity extends BaseBarActivity {
@Override
protected void onResume() {
mCastContext.getSessionManager().addSessionManagerListener(
mSessionManagerListener, CastSession.class);
if (mCastContext != null) {
mCastContext.getSessionManager().addSessionManagerListener(
mSessionManagerListener, CastSession.class);
}
super.onResume();
}
@Override
protected void onPause() {
mCastContext.getSessionManager().removeSessionManagerListener(
mSessionManagerListener, CastSession.class);
if (mCastContext != null) {
mCastContext.getSessionManager().removeSessionManagerListener(
mSessionManagerListener, CastSession.class);
}
super.onPause();
}