Fixed crash where recyclerAdapter is null

Closes #3138
This commit is contained in:
ByteHamster 2019-04-26 19:10:23 +02:00
parent 48ead285b3
commit 8e25f188c5
1 changed files with 3 additions and 1 deletions

View File

@ -272,7 +272,9 @@ public class QueueFragment extends Fragment {
boolean newLockState = !UserPreferences.isQueueLocked(); boolean newLockState = !UserPreferences.isQueueLocked();
UserPreferences.setQueueLocked(newLockState); UserPreferences.setQueueLocked(newLockState);
getActivity().supportInvalidateOptionsMenu(); getActivity().supportInvalidateOptionsMenu();
recyclerAdapter.setLocked(newLockState); if (recyclerAdapter != null) {
recyclerAdapter.setLocked(newLockState);
}
if (newLockState) { if (newLockState) {
Snackbar.make(getActivity().findViewById(R.id.content), R.string Snackbar.make(getActivity().findViewById(R.id.content), R.string
.queue_locked, Snackbar.LENGTH_SHORT).show(); .queue_locked, Snackbar.LENGTH_SHORT).show();