mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Fix for #159 force close during add feed (auto complete) now that is is enabled
again
This commit is contained in:
parent
5b8c5f0f83
commit
b245754710
1 changed files with 9 additions and 6 deletions
|
@ -700,12 +700,15 @@ public class APIManager {
|
|||
// TODO find a better way to identify these failed responses
|
||||
boolean isServerMessage = false;
|
||||
JsonParser parser = new JsonParser();
|
||||
JsonObject asJsonObject = parser.parse(json).getAsJsonObject();
|
||||
if(asJsonObject.has("code")) {
|
||||
JsonElement codeItem = asJsonObject.get("code");
|
||||
int code = codeItem.getAsInt();
|
||||
if(code == -1)
|
||||
isServerMessage = true;
|
||||
JsonElement jsonElement = parser.parse(json);
|
||||
if(jsonElement.isJsonObject()) {
|
||||
JsonObject asJsonObject = jsonElement.getAsJsonObject();
|
||||
if(asJsonObject.has("code")) {
|
||||
JsonElement codeItem = asJsonObject.get("code");
|
||||
int code = codeItem.getAsInt();
|
||||
if(code == -1)
|
||||
isServerMessage = true;
|
||||
}
|
||||
}
|
||||
return isServerMessage;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue