Refactor ZenWorkspaces to handle potential error when retrieving active workspace from cache

This commit is contained in:
mauro-balades 2024-09-22 18:27:56 +02:00
parent 9a1dcde549
commit fff6dac398

View file

@ -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