Skip to content

Commit

Permalink
fix(StatusDisplayItem): check if account is null before adding quote
Browse files Browse the repository at this point in the history
This should fix crashes in the ScheduledStatusListFragment,
as ScheduledStatus do not contain an account.
  • Loading branch information
FineFindus committed Aug 11, 2024
1 parent 134513b commit 42c55d5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public static ArrayList<StatusDisplayItem> buildItems(BaseStatusListFragment<?>
if(!statusForContent.mediaAttachments.isEmpty() && statusForContent.poll==null) // add spacing if immediately preceded by attachment
contentItems.add(new DummyStatusDisplayItem(parentID, fragment));
contentItems.addAll(buildItems(fragment, statusForContent.quote, accountID, parentObject, knownAccounts, filterContext, FLAG_NO_FOOTER|FLAG_INSET|FLAG_NO_EMOJI_REACTIONS|FLAG_IS_FOR_QUOTE));
} else if((flags & FLAG_INSET)==0 && statusForContent.mediaAttachments.isEmpty()){
} else if((flags & FLAG_INSET)==0 && statusForContent.mediaAttachments.isEmpty() && statusForContent.account!=null){
tryAddNonOfficialQuote(statusForContent, fragment, accountID, filterContext);
}
if(contentItems!=items && statusForContent.spoilerRevealed){
Expand Down Expand Up @@ -431,6 +431,7 @@ private static void tryAddNonOfficialQuote(Status status, BaseStatusListFragment
return;
String quoteURL=matcher.group();

// account may be null for scheduled posts
if (!UiUtils.looksLikeFediverseUrl(quoteURL))
return;

Expand Down

0 comments on commit 42c55d5

Please sign in to comment.