avoid causing and logging exception in getWebxdcInfo if getWebxdcInfoJson returns empty string

This commit is contained in:
adbenitez 2025-05-15 14:19:52 +02:00
parent 1566ea87d3
commit 16e89bb58a

View file

@ -142,11 +142,12 @@ public class DcMsg {
public native byte[] getWebxdcBlob (String filename); public native byte[] getWebxdcBlob (String filename);
public JSONObject getWebxdcInfo () { public JSONObject getWebxdcInfo () {
try { try {
return new JSONObject(getWebxdcInfoJson()); String json = getWebxdcInfoJson();
if (json != null && !json.isEmpty()) return new JSONObject(json);
} catch(Exception e) { } catch(Exception e) {
e.printStackTrace(); e.printStackTrace();
return new JSONObject();
} }
return new JSONObject();
} }
public native String getWebxdcHref (); public native String getWebxdcHref ();
public native boolean isForwarded (); public native boolean isForwarded ();