diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java index 811b09aa0..09b200b51 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java @@ -65,7 +65,6 @@ import com.watabou.utils.Random; import com.watabou.utils.Reflection; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; public class SandalsOfNature extends Artifact { @@ -256,8 +255,11 @@ public class SandalsOfNature extends Artifact { @Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle(bundle); + seeds.clear(); if (bundle.contains(SEEDS) && bundle.getClassArray(SEEDS) != null) { - Collections.addAll(seeds, bundle.getClassArray(SEEDS)); + for (Class seed : bundle.getClassArray(SEEDS)) { + if (seed != null) seeds.add(seed); + } } curSeedEffect = bundle.getClass(CUR_SEED_EFFECT); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java index 8f7fcdf5e..0afa42419 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java @@ -61,7 +61,6 @@ import com.watabou.utils.Random; import com.watabou.utils.Reflection; import java.util.ArrayList; -import java.util.Collections; public class UnstableSpellbook extends Artifact { @@ -330,8 +329,10 @@ public class UnstableSpellbook extends Artifact { public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle(bundle); scrolls.clear(); - if (bundle.contains(SCROLLS)) { - Collections.addAll(scrolls, bundle.getClassArray(SCROLLS)); + if (bundle.contains(SCROLLS) && bundle.getClassArray(SCROLLS) != null) { + for (Class scroll : bundle.getClassArray(SCROLLS)) { + if (scroll != null) scrolls.add(scroll); + } } }