diff --git a/src/lib/nodes/storage.ts b/src/lib/nodes/storage.ts index 8a14a77b4..0662633b5 100644 --- a/src/lib/nodes/storage.ts +++ b/src/lib/nodes/storage.ts @@ -47,10 +47,14 @@ export const nodesStorage = { getUseFastest(node: NodeType) { const options = optionsStorage.getItem() - return options[node].useFastest + return !!options[node]?.useFastest }, setUseFastest(value: boolean, node: NodeType) { const options = optionsStorage.getItem() + + if (!options[node]) { + options[node] = { useFastest: value } + } options[node].useFastest = value optionsStorage.setItem(options)