Skip to content

Commit

Permalink
npe fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliskov committed Jan 7, 2025
1 parent 06a3845 commit 838b3fd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ public void onButtonClicked(int buttonId, int buttonState) {
@Override
public void onButtonLongClicked(int buttonId, int buttonState) {
if (buttonId == R.id.action_content_block) {
ContentBlockSettingsPresenter.instance(getContext()).show(() -> onVideoLoaded(getPlayer().getVideo()));
ContentBlockSettingsPresenter.instance(getContext()).show(() -> {
if (getPlayer() != null) {
onVideoLoaded(getPlayer().getVideo());
}
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,17 @@ private void setupButtons() {

if (GeneralData.instance(getContext()).isGlobalClockEnabled()) {
mGlobalClock = (DateTimeView) findViewById(R.id.global_time);
mGlobalClock.showDate(false);
mGlobalClock.setVisibility(View.VISIBLE);
if (mGlobalClock != null) {
mGlobalClock.showDate(false);
mGlobalClock.setVisibility(View.VISIBLE);
}

mGlobalDate = (DateTimeView) findViewById(R.id.global_date);
mGlobalDate.showTime(false);
mGlobalDate.showDate(true);
mGlobalDate.setVisibility(View.VISIBLE);
if (mGlobalDate != null) {
mGlobalDate.showTime(false);
mGlobalDate.showDate(true);
mGlobalDate.setVisibility(View.VISIBLE);
}
}
}

Expand Down

0 comments on commit 838b3fd

Please sign in to comment.