Skip to content

Commit

Permalink
fix: NullPointerException if gcvote.com does not answer
Browse files Browse the repository at this point in the history
Change-Id: Id5c18f942617e950fb78315bd463fe113b9715a8
  • Loading branch information
Bananeweizen committed Jun 16, 2011
1 parent b77c29b commit 7966d42
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/carnero/cgeo/cgBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1919,6 +1919,9 @@ public HashMap<String, cgRating> getRating(ArrayList<String> guids, ArrayList<St
}
params.put("version", "cgeo");
final String votes = request(false, "gcvote.com", "/getVotes.php", "GET", params, false, false, false).getData();
if (votes == null) {
return null;
}

final Pattern patternLogIn = Pattern.compile("loggedIn='([^']+)'", Pattern.CASE_INSENSITIVE);
final Pattern patternGuid = Pattern.compile("cacheId='([^']+)'", Pattern.CASE_INSENSITIVE);
Expand Down Expand Up @@ -5705,7 +5708,7 @@ public String getMapUserToken(Handler noTokenHandler) {
}
}
}

if (noTokenHandler != null && (usertoken == null || usertoken.length() == 0)) {
noTokenHandler.sendEmptyMessage(0);
}
Expand Down

0 comments on commit 7966d42

Please sign in to comment.