fix: Don't crash when QR code can't be loaded (#3995)

Before this PR, when a QR code couldn't be loaded because of https://github.com/chatmail/core/pull/7399, Delta Chat crashed.

Now, the button does nothing.

It's not perfect, but easy to do, and only about an edge case where the user tried out the experimental broadcast channels in the past, and now tries to add a new member to a broadcast channel created with an old version of DC.

The hollistic alternative would be to switch to RPC for getSecurejoinQrSvg, so that the UI can get a proper error message.

---------

Co-authored-by: adb <adb@merlinux.eu>
This commit is contained in:
Hocuri
2025-11-05 17:26:32 +01:00
committed by GitHub
parent c4427c198e
commit 629ae0b16e
@@ -96,6 +96,12 @@ public class QrShowFragment extends Fragment implements DcEventCenter.DcEventDel
imageView.setSVG(svg);
} catch (SVGParseException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
Activity activity = getActivity();
if (activity != null) {
activity.finish();
}
}
view.findViewById(R.id.share_link_button).setOnClickListener((v) -> showInviteLinkDialog());