Fixed crash when clicking keep sorted on empty queue

This commit is contained in:
ByteHamster 2019-09-09 17:59:35 +02:00
parent 6dfff544e4
commit 6b79f740b2
1 changed files with 4 additions and 2 deletions

View File

@ -378,8 +378,10 @@ public class QueueFragment extends Fragment {
if (keepSortedNew) { if (keepSortedNew) {
SortOrder sortOrder = UserPreferences.getQueueKeepSortedOrder(); SortOrder sortOrder = UserPreferences.getQueueKeepSortedOrder();
QueueSorter.sort(sortOrder, true); QueueSorter.sort(sortOrder, true);
if (recyclerAdapter != null) {
recyclerAdapter.setLocked(true); recyclerAdapter.setLocked(true);
} else { }
} else if (recyclerAdapter != null) {
recyclerAdapter.setLocked(UserPreferences.isQueueLocked()); recyclerAdapter.setLocked(UserPreferences.isQueueLocked());
} }
getActivity().invalidateOptionsMenu(); getActivity().invalidateOptionsMenu();