mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
fix crash in JSONRPC
the fix could have been avoid by checking for null or not being overly specific with the exception. as this is a very sensible area, where any failure is dramatic, we do both.
This commit is contained in:
@@ -32,7 +32,7 @@ public class Rpc {
|
||||
String jsonResponse = dcJsonrpcInstance.getNextResponse();
|
||||
Response response = gson.fromJson(jsonResponse, Response.class);
|
||||
|
||||
if (response.id == 0) { // Got JSON-RPC notification/event, ignore
|
||||
if (response == null || response.id == 0) { // Got JSON-RPC notification/event, ignore
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class Rpc {
|
||||
while (true) {
|
||||
try {
|
||||
processResponse();
|
||||
} catch (JsonSyntaxException e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user