diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java b/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java index 16c8badb..393c8449 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java @@ -148,7 +148,7 @@ public class CacheController{ .map(ng->{ NotificationViewModel nvm=new NotificationViewModel(); nvm.notification=ng; - nvm.accounts=ng.sampleAccountIds.stream().map(accounts::get).collect(Collectors.toList()); + nvm.accounts=ng.sampleAccountIds.stream().map(accounts::get).filter(Objects::nonNull).collect(Collectors.toList()); if(nvm.accounts.size()!=ng.sampleAccountIds.size()) return null; if(ng.statusId!=null){ diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java index a25362ef..10446780 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java @@ -165,7 +165,10 @@ public class NotificationsListFragment extends BaseNotificationsListFragment{ for(int i=0;i holder){ - String itemID=getNotificationByID(holder.getItemID()).notification.pageMaxId; + NotificationViewModel n=getNotificationByID(holder.getItemID()); + if(n==null) + continue; + String itemID=n.notification.pageMaxId; if(ObjectIdComparator.INSTANCE.compare(itemID, unreadMarker)>0){ parent.getDecoratedBoundsWithMargins(child, tmpRect); c.drawRect(tmpRect, paint); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/AccountActivationFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/AccountActivationFragment.java index 5a71fcaf..93de44b7 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/AccountActivationFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/AccountActivationFragment.java @@ -131,7 +131,7 @@ public class AccountActivationFragment extends ToolbarFragment{ private void onOpenEmailClick(View v){ try{ startActivity(Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, Intent.CATEGORY_APP_EMAIL).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); - }catch(ActivityNotFoundException x){ + }catch(ActivityNotFoundException|IllegalArgumentException x){ Toast.makeText(getActivity(), R.string.no_app_to_handle_action, Toast.LENGTH_SHORT).show(); } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/MediaGridStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/MediaGridStatusDisplayItem.java index 83776629..c4447057 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/MediaGridStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/MediaGridStatusDisplayItem.java @@ -209,18 +209,22 @@ public class MediaGridStatusDisplayItem extends StatusDisplayItem{ @Override public void setImage(int index, Drawable drawable){ - controllers.get(index).setImage(drawable); + if(index