aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/cgBase.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-03-09 06:41:03 +0100
committerBananeweizen <bananeweizen@gmx.de>2012-03-09 06:41:03 +0100
commitdbbfd387fd1ff88f47b88166821ec858db73c5b0 (patch)
treef0b1b127499641c1e42658b89c0920b9d4d34505 /main/src/cgeo/geocaching/cgBase.java
parentd04d03c7d146547069329381f7e6c4f1bb6eefa7 (diff)
downloadcgeo-dbbfd387fd1ff88f47b88166821ec858db73c5b0.zip
cgeo-dbbfd387fd1ff88f47b88166821ec858db73c5b0.tar.gz
cgeo-dbbfd387fd1ff88f47b88166821ec858db73c5b0.tar.bz2
fix #1236: Fail to handle error on gc.com
Diffstat (limited to 'main/src/cgeo/geocaching/cgBase.java')
-rw-r--r--main/src/cgeo/geocaching/cgBase.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/cgBase.java b/main/src/cgeo/geocaching/cgBase.java
index 1c5adf8..fc14044 100644
--- a/main/src/cgeo/geocaching/cgBase.java
+++ b/main/src/cgeo/geocaching/cgBase.java
@@ -722,6 +722,12 @@ public class cgBase {
return searchResult;
}
+ final String cacheName = Html.fromHtml(BaseUtils.getMatch(page, GCConstants.PATTERN_NAME, true, "")).toString();
+ if ("An Error Has Occurred".equalsIgnoreCase(cacheName)) {
+ searchResult.error = StatusCode.UNKNOWN_ERROR;
+ return searchResult;
+ }
+
final cgCache cache = new cgCache();
cache.setDisabled(page.contains("<li>This cache is temporarily unavailable."));
@@ -741,7 +747,7 @@ public class cgBase {
cache.setGuid(BaseUtils.getMatch(page, GCConstants.PATTERN_GUID, true, cache.getGuid()));
// name
- cache.setName(Html.fromHtml(BaseUtils.getMatch(page, GCConstants.PATTERN_NAME, true, cache.getName())).toString());
+ cache.setName(cacheName);
// owner real name
cache.setOwnerReal(URLDecoder.decode(BaseUtils.getMatch(page, GCConstants.PATTERN_OWNERREAL, true, cache.getOwnerReal())));