mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 16:49:58 +02:00
Refactor ZenWorkspaces to handle potential error when retrieving active workspace from cache
This commit is contained in:
parent
9a1dcde549
commit
fff6dac398
1 changed files with 5 additions and 1 deletions
|
@ -39,7 +39,11 @@ var ZenWorkspaces = {
|
||||||
},
|
},
|
||||||
|
|
||||||
getActiveWorkspaceFromCache() {
|
getActiveWorkspaceFromCache() {
|
||||||
|
try {
|
||||||
return this._workspaceCache.workspaces.find((workspace) => workspace.used);
|
return this._workspaceCache.workspaces.find((workspace) => workspace.used);
|
||||||
|
} catch (e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Wrorkspaces saving/loading
|
// Wrorkspaces saving/loading
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue