mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-07-03 21:21:12 +08:00
Fix possible IllegalStateException in MatchList.fromJson
This commit is contained in:
parent
3dcfeb2078
commit
04fe20ca95
@ -435,8 +435,11 @@ public class MatchList {
|
||||
|
||||
public boolean fromJson(String json_str) {
|
||||
try {
|
||||
JsonObject obj = JsonParser.parseString(json_str).getAsJsonObject();
|
||||
return deserialize(obj);
|
||||
JsonElement el = JsonParser.parseString(json_str);
|
||||
if(!el.isJsonObject())
|
||||
return false;
|
||||
|
||||
return deserialize(el.getAsJsonObject());
|
||||
} catch (JsonSyntaxException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user