aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-09-12 21:00:54 +0200
committerBananeweizen <bananeweizen@gmx.de>2013-09-12 21:00:54 +0200
commitc7aae88d83016c3c9f7740b11227618f45a95e7b (patch)
treef0307e3d1e6c8b25cf0edcf453ea7019225e1663 /main/src
parent1dc15d879b14de1f9883ecb706755484d500a926 (diff)
downloadcgeo-c7aae88d83016c3c9f7740b11227618f45a95e7b.zip
cgeo-c7aae88d83016c3c9f7740b11227618f45a95e7b.tar.gz
cgeo-c7aae88d83016c3c9f7740b11227618f45a95e7b.tar.bz2
refactoring: workaround for null analysis
* Eclipse will not compile the following if statements otherwise
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/connector/gc/GCParser.java2
-rw-r--r--main/src/cgeo/geocaching/connector/gc/Login.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/connector/gc/GCParser.java b/main/src/cgeo/geocaching/connector/gc/GCParser.java
index 3885679..7eacb8e 100644
--- a/main/src/cgeo/geocaching/connector/gc/GCParser.java
+++ b/main/src/cgeo/geocaching/connector/gc/GCParser.java
@@ -309,7 +309,7 @@ public abstract class GCParser {
final String coordinates = Network.getResponseData(Network.postRequest("http://www.geocaching.com/seek/nearest.aspx", params), false);
if (StringUtils.isNotBlank(coordinates)) {
- if (coordinates.contains("You have not agreed to the license agreement. The license agreement is required before you can start downloading GPX or LOC files from Geocaching.com")) {
+ if (coordinates != null && coordinates.contains("You have not agreed to the license agreement. The license agreement is required before you can start downloading GPX or LOC files from Geocaching.com")) {
Log.i("User has not agreed to the license agreement. Can\'t download .loc file.");
searchResult.setError(StatusCode.UNAPPROVED_LICENSE);
diff --git a/main/src/cgeo/geocaching/connector/gc/Login.java b/main/src/cgeo/geocaching/connector/gc/Login.java
index 9a3a8ba..10ea18d 100644
--- a/main/src/cgeo/geocaching/connector/gc/Login.java
+++ b/main/src/cgeo/geocaching/connector/gc/Login.java
@@ -114,7 +114,7 @@ public abstract class Login {
loginResponse = Network.postRequest("https://www.geocaching.com/login/default.aspx", params);
loginData = Network.getResponseData(loginResponse);
- if (StringUtils.isBlank(loginData)) {
+ if (loginData == null || StringUtils.isBlank(loginData)) {
Log.e("Login.login: Failed to retrieve login page (2nd)");
// FIXME: should it be CONNECTION_FAILED to match the first attempt?
return StatusCode.COMMUNICATION_ERROR; // no login page