mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
fix: null checking
This commit is contained in:
parent
5d4dfe1ac7
commit
9aadcb91fb
3 changed files with 11 additions and 5 deletions
|
|
@ -706,7 +706,9 @@ public class HomeTabMusicFragment extends Fragment implements ClickCallback {
|
|||
private void refreshSharesView() {
|
||||
final Handler handler = new Handler();
|
||||
final Runnable runnable = () -> {
|
||||
if (Preferences.isSharingEnabled()) homeViewModel.refreshShares(getViewLifecycleOwner());
|
||||
if (getView() != null && bind != null && Preferences.isSharingEnabled()) {
|
||||
homeViewModel.refreshShares(getViewLifecycleOwner());
|
||||
}
|
||||
};
|
||||
handler.postDelayed(runnable, 100);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -254,7 +254,12 @@ public class LibraryFragment extends Fragment implements ClickCallback {
|
|||
|
||||
private void refreshPlaylistView() {
|
||||
final Handler handler = new Handler();
|
||||
final Runnable runnable = () -> libraryViewModel.refreshPlaylistSample(getViewLifecycleOwner());
|
||||
|
||||
final Runnable runnable = () -> {
|
||||
if (getView() != null && bind != null && libraryViewModel != null)
|
||||
libraryViewModel.refreshPlaylistSample(getViewLifecycleOwner());
|
||||
};
|
||||
|
||||
handler.postDelayed(runnable, 100);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,9 +61,8 @@ public class AlbumCatalogueViewModel extends AndroidViewModel {
|
|||
.enqueue(new Callback<ApiResponse>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ApiResponse> call, @NonNull retrofit2.Response<ApiResponse> response) {
|
||||
if (response.isSuccessful() && response.body() != null && response.body().getSubsonicResponse().getAlbumList2() != null) {
|
||||
List<AlbumID3> albumList = new ArrayList<>();
|
||||
albumList.addAll(response.body().getSubsonicResponse().getAlbumList2().getAlbums());
|
||||
if (response.isSuccessful() && response.body() != null && response.body().getSubsonicResponse().getAlbumList2() != null && response.body().getSubsonicResponse().getAlbumList2().getAlbums() != null) {
|
||||
List<AlbumID3> albumList = new ArrayList<>(response.body().getSubsonicResponse().getAlbumList2().getAlbums());
|
||||
callback.onLoadMedia(albumList);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue