fix: lastErrorMessage error

This commit is contained in:
ppedziwiatr
2023-07-13 14:24:51 +02:00
committed by just_ppe
parent e5c2519a9d
commit 23bd271f83

View File

@@ -142,7 +142,8 @@ export abstract class AbstractContractHandler<State> implements HandlerApi<State
const lastErrorKey = errorKeys[errorKeys.length - 1] as string; const lastErrorKey = errorKeys[errorKeys.length - 1] as string;
const lastErrorMessage = stateWithValidity?.cachedValue?.errorMessages[lastErrorKey]; const lastErrorMessage = stateWithValidity?.cachedValue?.errorMessages[lastErrorKey];
// don't judge me.. // don't judge me..
if (lastErrorMessage.startsWith('[SkipUnsafeError]')) { // FIXME: also - '?' is stinky...
if (lastErrorMessage?.startsWith('[SkipUnsafeError]')) {
throw new ContractError(lastErrorMessage); throw new ContractError(lastErrorMessage);
} }
} }