diff --git a/src/core/modules/impl/CacheableStateEvaluator.ts b/src/core/modules/impl/CacheableStateEvaluator.ts index 64f0aa3..d056cb5 100644 --- a/src/core/modules/impl/CacheableStateEvaluator.ts +++ b/src/core/modules/impl/CacheableStateEvaluator.ts @@ -52,8 +52,8 @@ export class CacheableStateEvaluator extends DefaultStateEvaluator { const isFirstEvaluation = cachedState == null; let baseState = isFirstEvaluation ? executionContext.contractDefinition.initState : cachedState.cachedValue.state; - const baseValidity = isFirstEvaluation ? {} : cachedState.cachedValue.validity; - const baseErrorMessages = isFirstEvaluation ? {} : cachedState.cachedValue.errorMessages; + const baseValidity = isFirstEvaluation ? {} : cachedState.cachedValue.validity || {}; + const baseErrorMessages = isFirstEvaluation ? {} : cachedState.cachedValue.errorMessages || {}; if (isFirstEvaluation) { baseState = await executionContext.handler.maybeCallStateConstructor( @@ -81,7 +81,7 @@ export class CacheableStateEvaluator extends DefaultStateEvaluator { // eval state for the missing transactions - starting from the latest value from cache. return await this.doReadState( missingInteractions, - new EvalStateResult(baseState, baseValidity, baseErrorMessages || {}), + new EvalStateResult(baseState, baseValidity, baseErrorMessages), executionContext ); }