From d09a4a3ff4b6b04fc623ff5a424b7edc9ef44cab Mon Sep 17 00:00:00 2001 From: Vexatos Date: Tue, 3 Oct 2017 19:05:30 +0200 Subject: [PATCH] Fix yet another silly error related to null ItemStacks. --- .../li/cil/oc/common/inventory/ItemStackInventory.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/scala/li/cil/oc/common/inventory/ItemStackInventory.scala b/src/main/scala/li/cil/oc/common/inventory/ItemStackInventory.scala index 626afc3f1..1c04f22fd 100644 --- a/src/main/scala/li/cil/oc/common/inventory/ItemStackInventory.scala +++ b/src/main/scala/li/cil/oc/common/inventory/ItemStackInventory.scala @@ -12,8 +12,11 @@ trait ItemStackInventory extends Inventory { override def items = inventory // Initialize the list automatically if we have a container. - if (!container.isEmpty) { - reinitialize() + { + val _container = container + if (_container != null && !_container.isEmpty) { + reinitialize() + } } // Load items from tag.