Skip to content

Commit 24f4512

Browse files
committed
fix #2040: ignore & trace invalid tab id in cache
1 parent 8aad646 commit 24f4512

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/background/tab-manager.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ export const get = (tabId, ...keyPath) => {
2222
* (tabId, 'foo', 'bar', 'etc', 123) will set tabId's meta to {foo: {bar: {etc: 123}}}
2323
*/
2424
export const set = function (tabId, ...args) {
25+
if (!+tabId) {
26+
console.trace(`tabCache.set() params are invalid: ${tabId}, ${JSON.stringify(args)}`);
27+
return;
28+
}
2529
const depth = args.length - 2;
2630
const lastKey = args[depth];
2731
const value = args[depth + 1];

0 commit comments

Comments
 (0)