wrap in try catch

This commit is contained in:
Mutasem 2021-11-30 17:45:20 +01:00
parent 462ea0a4ae
commit 4b0444747f

View file

@ -2021,8 +2021,14 @@ export default mixins(
deleteEveryEndpoint () {
if (this.instance) {
const nodes = this.$store.getters.allNodes as INodeUi[];
// @ts-ignore
nodes.forEach((node: INodeUi) => this.instance.destroyDraggable(`${NODE_NAME_PREFIX}${this.$store.getters.getNodeIndex(node.name)}`));
nodes.forEach((node: INodeUi) => {
try {
// @ts-ignore
this.instance.destroyDraggable(`${NODE_NAME_PREFIX}${this.$store.getters.getNodeIndex(node.name)}`); // eslint-disable-line no-console
} catch (e) {
console.error(e);
}
});
// On first load it does not exist
this.instance.deleteEveryEndpoint();