Merge pull request #8413 from vvlladd28/bug/rule-node/test-node-script/parse-json

Fixed error when call test function in rule node
This commit is contained in:
Andrew Shvayka 2023-04-21 17:33:54 +03:00 committed by GitHub
commit 631f1db378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,10 +46,14 @@ export class NodeScriptTestService {
let msgType: string;
if (debugIn) {
if (debugIn.data) {
msg = JSON.parse(debugIn.data);
try {
msg = JSON.parse(debugIn.data);
} catch (e) {}
}
if (debugIn.metadata) {
metadata = JSON.parse(debugIn.metadata);
try {
metadata = JSON.parse(debugIn.metadata);
} catch (e) {}
}
msgType = debugIn.msgType;
}