Updated on 2026-08-14

This commit is contained in:
Tangem 2018-12-07 23:00:25 +03:00
commit d4e76c4a00
4 changed files with 38 additions and 15 deletions

View file

@ -156,11 +156,20 @@ public class ElectrumRequest {
}
public JSONObject getError() throws JSONException {
return getAnswer().getJSONObject("error");
JSONObject answer = getAnswer();
if (answer.has("error")) {
return getAnswer().getJSONObject("error");
} else {
return null;
}
}
public String getResultString() throws JSONException {
return getAnswer().getString("result");
if (getAnswer().has("result")) {
return getAnswer().getString("result");
} else {
return null;
}
}
public JSONArray getResultArray() throws JSONException {