From 30c0d0d9080561ad0c8f0200daea4c1eca637124 Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Tue, 11 Feb 2025 21:00:05 +1100
Subject: bar: fix null pointer error

Client workspaces can be null for some reason?
---
 src/modules/bar.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/modules/bar.tsx')

diff --git a/src/modules/bar.tsx b/src/modules/bar.tsx
index ae5cde9..ea953d7 100644
--- a/src/modules/bar.tsx
+++ b/src/modules/bar.tsx
@@ -146,7 +146,7 @@ const Workspace = ({ idx }: { idx: number }) => {
                 const update = () =>
                     self.toggleClassName(
                         "occupied",
-                        hyprland.clients.some(c => c.workspace.id === wsId)
+                        hyprland.clients.some(c => c.workspace?.id === wsId)
                     );
 
                 self.hook(hyprland, "notify::focused-workspace", () => {
-- 
cgit v1.2.3-freya

