diff --git a/src/main/scala/li/cil/oc/common/SaveHandler.scala b/src/main/scala/li/cil/oc/common/SaveHandler.scala index b16a850d4..c7fb5b454 100644 --- a/src/main/scala/li/cil/oc/common/SaveHandler.scala +++ b/src/main/scala/li/cil/oc/common/SaveHandler.scala @@ -83,11 +83,16 @@ object SaveHandler { def loadNBT(nbt: NBTTagCompound, name: String): NBTTagCompound = { val data = load(nbt, name) - if (data.length > 0) { + if (data.length > 0) try { val bais = new ByteArrayInputStream(data) val dis = new DataInputStream(bais) CompressedStreamTools.read(dis) } + catch { + case t: Throwable => + OpenComputers.log.warn("There was an error trying to restore a block's state from external data. This indicates that data was somehow corrupted.", t) + new NBTTagCompound() + } else new NBTTagCompound() }