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:id="@+id/nav_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:labelVisibilityMode="unlabeled"
android:layout_marginStart="0dp" android:layout_marginStart="0dp"
android:layout_marginEnd="0dp" android:layout_marginEnd="0dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"

View file

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