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

View file

@ -106,7 +106,7 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
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);
}