[gnome-shell/wip/jimmac/dash-icon-spacing: 53/72] workspacesView: Check for primaryView being null




commit 1d20ad37194de701a2cb733d8fe8d37847a59d47
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jan 4 17:42:26 2021 +0100

    workspacesView: Check for primaryView being null
    
    This is possible according to the getter, and triggers warnings
    seen when going back from overview via gestures.

 js/ui/workspacesView.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 354cf6aaac..f5689f849f 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -825,7 +825,10 @@ class WorkspacesDisplay extends St.Widget {
     }
 
     activeWorkspaceHasMaximizedWindows() {
-        return this._getPrimaryView().getActiveWorkspace().hasMaximizedWindows();
+        const primaryView = this._getPrimaryView();
+        return primaryView
+            ? primaryView.getActiveWorkspace().hasMaximizedWindows()
+            : false;
     }
 
     vfunc_parent_set(oldParent) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]