aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/utils
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-11-18 10:19:52 +0100
committerBananeweizen <bananeweizen@gmx.de>2012-11-18 10:19:52 +0100
commit5f983eef81e31207857eb8142b7d41f8bc511b46 (patch)
tree6b2252b9874c89c866016f0241a58e7e1be98f8a /main/src/cgeo/geocaching/utils
parent2e00c7a146e7718420be288e2073cc144d054f4f (diff)
downloadcgeo-5f983eef81e31207857eb8142b7d41f8bc511b46.zip
cgeo-5f983eef81e31207857eb8142b7d41f8bc511b46.tar.gz
cgeo-5f983eef81e31207857eb8142b7d41f8bc511b46.tar.bz2
fix #2167: Not possible to open OP caches
Diffstat (limited to 'main/src/cgeo/geocaching/utils')
-rw-r--r--main/src/cgeo/geocaching/utils/LazyInitializedList.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/utils/LazyInitializedList.java b/main/src/cgeo/geocaching/utils/LazyInitializedList.java
index 76876fc..25af811 100644
--- a/main/src/cgeo/geocaching/utils/LazyInitializedList.java
+++ b/main/src/cgeo/geocaching/utils/LazyInitializedList.java
@@ -32,11 +32,19 @@ public abstract class LazyInitializedList<ElementType> implements Iterable<Eleme
}
public void set(final List<ElementType> elements) {
- list = new ArrayList<ElementType>(elements);
+ if (elements != null) {
+ list = new ArrayList<ElementType>(elements);
+ } else {
+ list = new ArrayList<ElementType>();
+ }
}
public void set(LazyInitializedList<ElementType> other) {
- list = new ArrayList<ElementType>(other.asList());
+ if (other != null) {
+ list = new ArrayList<ElementType>(other.asList());
+ } else {
+ list = new ArrayList<ElementType>();
+ }
}
public boolean isEmpty() {