fix(core): Ensure error.message is a string before checking for specific messages (#17417)

This commit is contained in:
Pavel
2025-08-19 16:40:22 +03:00
committed by GitHub
parent 554327ee78
commit 0d4c89058d
9 changed files with 38 additions and 24 deletions

View File

@@ -161,7 +161,7 @@ export async function execute(
returnData.push(newItem);
} catch (error) {
let errorDescription;
if (error.message.includes('Unexpected token')) {
if (typeof error.message === 'string' && error.message.includes('Unexpected token')) {
error.message = "The file selected in 'Input Binary Field' is not in JSON format";
errorDescription =
"Try to change the operation or select a JSON file in 'Input Binary Field'";