diff --git a/WordPress/src/main/java/org/wordpress/android/ui/media/MediaBrowserActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/media/MediaBrowserActivity.java index dede611f1f95..022523def4dd 100755 --- a/WordPress/src/main/java/org/wordpress/android/ui/media/MediaBrowserActivity.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/media/MediaBrowserActivity.java @@ -804,17 +804,15 @@ public void onMediaChanged(OnMediaChanged event) { switch (event.cause) { case DELETE_MEDIA: - if (event.mediaList != null) { - // If the media was deleted, remove it from multi select if it was selected - for (MediaModel mediaModel : event.mediaList) { - int localMediaId = mediaModel.getId(); - mMediaGridFragment.removeFromMultiSelect(localMediaId); - } + // If the media was deleted, remove it from multi select if it was selected + for (MediaModel mediaModel : event.mediaList) { + int localMediaId = mediaModel.getId(); + mMediaGridFragment.removeFromMultiSelect(localMediaId); } break; } - if (event.mediaList != null && event.mediaList.size() == 1) { + if (event.mediaList.size() == 1) { updateMediaGridItem(event.mediaList.get(0), true); } else { reloadMediaGrid(); diff --git a/WordPress/src/main/java/org/wordpress/android/ui/media/services/MediaDeleteService.java b/WordPress/src/main/java/org/wordpress/android/ui/media/services/MediaDeleteService.java index d2ec601503c1..00ea8471bf6f 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/media/services/MediaDeleteService.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/media/services/MediaDeleteService.java @@ -102,7 +102,7 @@ public int onStartCommand(Intent intent, int flags, int startId) { @Subscribe(threadMode = ThreadMode.MAIN) public void onMediaChanged(OnMediaChanged event) { // event for unknown media, ignoring - if (event.mediaList == null || event.mediaList.isEmpty() || !matchesInProgressMedia(event.mediaList.get(0))) { + if (event.mediaList.isEmpty() || !matchesInProgressMedia(event.mediaList.get(0))) { AppLog.w(T.MEDIA, "Media event not recognized: " + event.mediaList); return; } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/PostListEventListener.kt b/WordPress/src/main/java/org/wordpress/android/ui/posts/PostListEventListener.kt index 0c9e9b3b6190..89032b7472eb 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/PostListEventListener.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/PostListEventListener.kt @@ -174,7 +174,7 @@ class PostListEventListener( @Suppress("unused") @Subscribe(threadMode = BACKGROUND) fun onMediaChanged(event: OnMediaChanged) { - if (!event.isError && event.mediaList != null) { + if (!event.isError) { featuredMediaChanged(*event.mediaList.map { it.mediaId }.toLongArray()) uploadStatusChanged(*event.mediaList.map { it.localPostId }.toIntArray()) } diff --git a/WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListEventListener.kt b/WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListEventListener.kt index 4a2531690077..d7fb9833d072 100644 --- a/WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListEventListener.kt +++ b/WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListEventListener.kt @@ -117,9 +117,7 @@ class PageListEventListener( @Suppress("unused") @Subscribe(threadMode = BACKGROUND) fun onMediaChanged(event: OnMediaChanged) { - if (event.mediaList != null) { - uploadStatusChanged(*event.mediaList.map { LocalId(it.localPostId) }.toTypedArray()) - } + uploadStatusChanged(*event.mediaList.map { LocalId(it.localPostId) }.toTypedArray()) } @Suppress("unused") diff --git a/WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListViewModel.kt b/WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListViewModel.kt index ef1ff1ba255d..394a57f64d79 100644 --- a/WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListViewModel.kt @@ -498,7 +498,7 @@ class PageListViewModel @Inject constructor( @Suppress("unused") @Subscribe(threadMode = ThreadMode.BACKGROUND) fun onMediaChanged(event: OnMediaChanged) { - if (!event.isError && event.mediaList != null) { + if (!event.isError) { invalidateFeaturedMedia(*event.mediaList.map { it.mediaId }.toLongArray()) } }