fix(scheduled-posts): only throw account missing error if scheduledStatus is null

This fixes #623
This commit is contained in:
LucasGGamerM
2025-05-14 18:52:23 -03:00
parent ab2256f90c
commit 2f16e06750

View File

@@ -181,13 +181,13 @@ public abstract class StatusDisplayItem{
Bundle args=new Bundle();
args.putString("account", accountID);
try{
ScheduledStatus scheduledStatus=parentObject instanceof ScheduledStatus s ? s : null;
// Check if account is null. This should never happen, but it seems to do in latest versions of glitch-soc
if (status.account == null || (status.reblog != null && status.reblog.account == null) || (status.quote != null) && status.quote.account == null) {
if (scheduledStatus == null && status.account == null || (status.reblog != null && status.reblog.account == null) || (status.quote != null) && status.quote.account == null) {
throw new Exception("status " + status.url + " has null account field");
}
ScheduledStatus scheduledStatus=parentObject instanceof ScheduledStatus s ? s : null;
HeaderStatusDisplayItem header=null;
boolean hideCounts=!AccountSessionManager.get(accountID).getLocalPreferences().showInteractionCounts;