aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-01-04 20:05:40 +0100
committerBananeweizen <bananeweizen@gmx.de>2012-01-04 20:05:40 +0100
commit610379fb56406b0d4ac2b4f30f0d28dcdbb34e2e (patch)
tree0493ba1c183e453d38784e36e489dee84a643e7c /main/src
parent6a51296c54e9ddc339a63bd6258adddad6258ece (diff)
downloadcgeo-610379fb56406b0d4ac2b4f30f0d28dcdbb34e2e.zip
cgeo-610379fb56406b0d4ac2b4f30f0d28dcdbb34e2e.tar.gz
cgeo-610379fb56406b0d4ac2b4f30f0d28dcdbb34e2e.tar.bz2
fix: NPE for imported caches without any log
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/CacheDetailActivity.java2
-rw-r--r--main/src/cgeo/geocaching/cgBase.java2
-rw-r--r--main/src/cgeo/geocaching/cgCache.java5
3 files changed, 6 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java
index 7cb33af..602f340 100644
--- a/main/src/cgeo/geocaching/CacheDetailActivity.java
+++ b/main/src/cgeo/geocaching/CacheDetailActivity.java
@@ -2204,7 +2204,7 @@ public class CacheDetailActivity extends AbstractActivity {
// cache logs
RelativeLayout rowView;
- if (cache != null && cache.getLogs(allLogs) != null) {
+ if (cache != null) {
for (cgLog log : cache.getLogs(allLogs)) {
rowView = (RelativeLayout) getLayoutInflater().inflate(R.layout.cacheview_logs_item, null);
diff --git a/main/src/cgeo/geocaching/cgBase.java b/main/src/cgeo/geocaching/cgBase.java
index 9097e75..273b36b 100644
--- a/main/src/cgeo/geocaching/cgBase.java
+++ b/main/src/cgeo/geocaching/cgBase.java
@@ -2674,7 +2674,7 @@ public class cgBase {
}
// store images from logs
- if (Settings.isStoreLogImages() && cache.getLogs(true) != null) {
+ if (Settings.isStoreLogImages()) {
for (cgLog log : cache.getLogs(true)) {
if (CollectionUtils.isNotEmpty(log.logImages)) {
for (cgImage oneLogImg : log.logImages) {
diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java
index 92023e5..2f9f09c 100644
--- a/main/src/cgeo/geocaching/cgCache.java
+++ b/main/src/cgeo/geocaching/cgCache.java
@@ -804,9 +804,12 @@ public class cgCache implements ICache {
/**
* @param allLogs
* true for all logs, false for friend logs only
- * @return the logs with all entries or just the entries of the friends
+ * @return the logs with all entries or just the entries of the friends, never <code>null</code>
*/
public List<cgLog> getLogs(boolean allLogs) {
+ if (logs == null) {
+ return Collections.emptyList();
+ }
if (allLogs) {
return logs;
}