1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-01-05 06:50:31 +00:00

Fix some sonar warnings and make some smaller improvements

This commit is contained in:
TobiGr 2023-08-11 23:12:47 +02:00
parent ac5f991c0c
commit db5ed48dbb
2 changed files with 5 additions and 9 deletions

View File

@ -585,13 +585,11 @@ public final class PlayQueueActivity extends AppCompatActivity
} }
private void onPlaybackParameterChanged(@Nullable final PlaybackParameters parameters) { private void onPlaybackParameterChanged(@Nullable final PlaybackParameters parameters) {
if (parameters != null) { if (parameters != null && menu != null && player != null) {
if (menu != null && player != null) {
final MenuItem item = menu.findItem(R.id.action_playback_speed); final MenuItem item = menu.findItem(R.id.action_playback_speed);
item.setTitle(formatSpeed(parameters.speed)); item.setTitle(formatSpeed(parameters.speed));
} }
} }
}
private void onMaybeMuteChanged() { private void onMaybeMuteChanged() {
if (menu != null && player != null) { if (menu != null && player != null) {

View File

@ -73,11 +73,9 @@ public final class TabsManager {
private SharedPreferences.OnSharedPreferenceChangeListener getPreferenceChangeListener() { private SharedPreferences.OnSharedPreferenceChangeListener getPreferenceChangeListener() {
return (sp, key) -> { return (sp, key) -> {
if (savedTabsKey.equals(key)) { if (savedTabsKey.equals(key) && savedTabsChangeListener != null) {
if (savedTabsChangeListener != null) {
savedTabsChangeListener.onTabsChanged(); savedTabsChangeListener.onTabsChanged();
} }
}
}; };
} }