Fix issue when undefined data in AVM client caused FJS to fail (#313)

This commit is contained in:
Pavel 2022-09-07 12:55:23 +03:00 committed by GitHub
parent b4195175db
commit a2f996dde2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,14 +154,7 @@ export async function callAvm(
data: Uint8Array,
callResults: CallResultsArray,
): Promise<InterpreterResult> {
try {
const avmArg = serializeAvmArgs(runParams, air, prevData, data, callResults);
const rawResult = await fn(avmArg);
return deserializeAvmResult(rawResult);
} catch (e) {
return {
retCode: -1,
errorMessage: 'marine-js call failed, ' + e,
} as any;
}
const avmArg = serializeAvmArgs(runParams, air, prevData, data, callResults);
const rawResult = await fn(avmArg);
return deserializeAvmResult(rawResult);
}