Commit bd4a354d authored by Rocky Rococo's avatar Rocky Rococo
Browse files

Fix NPE when attempting to decrypt null object "decryptedPayload"

parent 85f9d792
......@@ -303,22 +303,23 @@ public class AppUtil {
Looper.prepare();
try {
JSONObject json = new JSONObject(decryptedPayload);
if(json != null && (json.has("xpubs") || json.has("legacy"))) {
SamouraiSentinel.getInstance(context).parseJSON(json);
try {
SamouraiSentinel.getInstance(context).serialize(SamouraiSentinel.getInstance(context).toJSON(), null);
} catch (IOException ioe) {
;
} catch (JSONException je) {
;
if (decryptedPayload != null) {
JSONObject json = new JSONObject(decryptedPayload);
if (json != null && (json.has("xpubs") || json.has("legacy"))) {
SamouraiSentinel.getInstance(context).parseJSON(json);
try {
SamouraiSentinel.getInstance(context).serialize(SamouraiSentinel.getInstance(context).toJSON(), null);
} catch (IOException ioe) {
;
} catch (JSONException je) {
;
}
AppUtil.getInstance(context).restartApp();
}
AppUtil.getInstance(context).restartApp();
}
}
catch(JSONException je) {
je.printStackTrace();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment