diff --git a/src/main/scala/scorex/crypto/authds/avltree/batch/PersistentBatchAVLProver.scala b/src/main/scala/scorex/crypto/authds/avltree/batch/PersistentBatchAVLProver.scala index b9d8d29b..18bd9e8b 100644 --- a/src/main/scala/scorex/crypto/authds/avltree/batch/PersistentBatchAVLProver.scala +++ b/src/main/scala/scorex/crypto/authds/avltree/batch/PersistentBatchAVLProver.scala @@ -55,8 +55,11 @@ object PersistentBatchAVLProver { case Some(ver) => rollback(ver).get case None => generateProofAndUpdateStorage(additionalData) //to initialize storage and clear prover's state }).ensuring { _ => - storage.version.get.sameElements(avlProver.digest) && - (!paranoidChecks || Try(avlProver.checkTree(true)).isSuccess) + storage.version match { + case Some(ver) => ver.sameElements(avlProver.digest) && + (!paranoidChecks || Try(avlProver.checkTree(true)).isSuccess) + case None => true + } } } }