avoid crash in orphan info messages from webxdc

This commit is contained in:
adbenitez 2025-03-18 19:41:19 +01:00
parent ad1159c05c
commit 3e21f9be4d
2 changed files with 5 additions and 2 deletions

View file

@ -747,7 +747,10 @@ public class ConversationFragment extends MessageSelectorFragment
DozeReminder.dozeReminderTapped(getContext()); DozeReminder.dozeReminderTapped(getContext());
} }
else if(messageRecord.getInfoType() == DcMsg.DC_INFO_WEBXDC_INFO_MESSAGE) { else if(messageRecord.getInfoType() == DcMsg.DC_INFO_WEBXDC_INFO_MESSAGE) {
WebxdcActivity.openWebxdcActivity(getContext(), messageRecord.getParent(), messageRecord.getWebxdcHref()); if (messageRecord.getParent() != null) {
// if the parent webxdc message still exists
WebxdcActivity.openWebxdcActivity(getContext(), messageRecord.getParent(), messageRecord.getWebxdcHref());
}
} }
else { else {
String self_mail = dcContext.getConfig("configured_mail_user"); String self_mail = dcContext.getConfig("configured_mail_user");

View file

@ -106,7 +106,7 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
openWebxdcActivity(context, instance, ""); openWebxdcActivity(context, instance, "");
} }
public static void openWebxdcActivity(Context context, DcMsg instance, String href) { public static void openWebxdcActivity(Context context, @NonNull DcMsg instance, String href) {
openWebxdcActivity(context, instance.getId(), false, href); openWebxdcActivity(context, instance.getId(), false, href);
} }