From 4ce74c4dc5302fdd7b33441c2f5999d458c58dab Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Wed, 15 Jan 2025 00:35:41 +1100
Subject: bar: fix null pointer errors

---
 modules/bar.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'modules/bar.tsx')

diff --git a/modules/bar.tsx b/modules/bar.tsx
index dd576c3..9801f13 100644
--- a/modules/bar.tsx
+++ b/modules/bar.tsx
@@ -51,12 +51,14 @@ const ActiveWindow = () => (
             className="icon"
             setup={self =>
                 hookFocusedClientProp(self, "class", c => {
-                    self.label = c ? getAppCategoryIcon(c.class) : "desktop_windows";
+                    self.label = c?.class ? getAppCategoryIcon(c.class) : "desktop_windows";
                 })
             }
         />
         <label
-            setup={self => hookFocusedClientProp(self, "title", c => (self.label = c ? ellipsize(c.title) : "Desktop"))}
+            setup={self =>
+                hookFocusedClientProp(self, "title", c => (self.label = c?.title ? ellipsize(c.title) : "Desktop"))
+            }
         />
     </box>
 );
-- 
cgit v1.2.3-freya

