Fix ext storage NPE

This commit is contained in:
Raoul Van den Berge
2016-11-03 16:24:17 +01:00
parent 18cdce8b13
commit 2a5a5220f0

View File

@@ -58,7 +58,11 @@ public abstract class ItemStorageExternal implements IItemStorage {
// In that case, we remove the items that have been removed due to the shrinkage // In that case, we remove the items that have been removed due to the shrinkage
if (cache.size() > newStacks.size()) { if (cache.size() > newStacks.size()) {
for (int i = newStacks.size(); i < cache.size(); ++i) { for (int i = newStacks.size(); i < cache.size(); ++i) {
changes.add(ItemHandlerHelper.copyStackWithSize(cache.get(i), -cache.get(i).stackSize)); ItemStack change = ItemHandlerHelper.copyStackWithSize(cache.get(i), -cache.get(i).stackSize);
if (change != null) {
changes.add(change);
}
} }
} }