Merge pull request #505 from FineFindus/fix/scheduled-status-quote-crash

fix(StatusDisplayItem): check if account is null before adding quote
This commit is contained in:
LucasGGamerM 2024-08-11 19:32:08 -03:00 committed by GitHub
commit b07789b346
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -341,7 +341,7 @@ public abstract class StatusDisplayItem{
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){
@ -431,6 +431,7 @@ public abstract class StatusDisplayItem{
return;
String quoteURL=matcher.group();
// account may be null for scheduled posts
if (!UiUtils.looksLikeFediverseUrl(quoteURL))
return;