Skip to content

Commit df4ffdc

Browse files
authored
warn and ignore on none existent blocks, rather than crashing the entire editor
1 parent 66e896b commit df4ffdc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/addons/addons/multi-tab-code/userscript.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,10 @@ export default async function ({ addon, msg, console }) {
544544
.filter(tab => tab.scripts.length > 0)
545545
.map((tab, idx) => {
546546
for (const script of tab.scripts) {
547+
if (!tabTarget.blocks._blocks[script]) {
548+
console.warn('Ignoring none existent block', script, 'while saving for tab', selectedTab);
549+
continue;
550+
}
547551
tabTarget.blocks._blocks[script].mutation ??= { children: [] };
548552
tabTarget.blocks._blocks[script].mutation.blockId = script;
549553
}

0 commit comments

Comments
 (0)