浏览代码

fixed error if tab data is not found

Gildas 7 年之前
父节点
当前提交
ac7d51fa3b
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      extension/ui/bg/ui-button.js

+ 3 - 1
extension/ui/bg/ui-button.js

@@ -133,7 +133,9 @@ singlefile.ui.button = (() => {
 		const autoSave = await singlefile.ui.autosave.isEnabled(tab.id);
 		if (reset) {
 			const tabsData = await singlefile.storage.getTemporary();
-			tabsData[tab.id].button = null;
+			if (tabsData[tab.id]) {
+				tabsData[tab.id].button = null;
+			}
 		}
 		const properties = await getCurrentProperties(tab.id, { autoSave });
 		await refresh(tab.id, properties, true);