mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 00: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() {
|
||||
return this._workspaceCache.workspaces.find((workspace) => workspace.used);
|
||||
try {
|
||||
return this._workspaceCache.workspaces.find((workspace) => workspace.used);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
// Wrorkspaces saving/loading
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue