Throwing error for invalid shape

This commit is contained in:
Knut Sveidqvist
2024-09-13 11:23:28 +02:00
parent 2fa044d484
commit d8c340d9c5

View File

@@ -244,8 +244,11 @@ export const insertNode = async (elem, node, dir) => {
}
}
// Add link when appropriate
if (!shapes[node.shape]) {
throw new Error(`No such shape: ${node.shape}. Please check your syntax.`);
}
if (node.link) {
// Add link when appropriate
let target;
if (getConfig().securityLevel === 'sandbox') {
target = '_top';