From 0194b45dc7a259fc5a7619e66b67ab3cfc65e12a Mon Sep 17 00:00:00 2001
From: matt1432 <matt@nelim.org>
Date: Mon, 27 Nov 2023 15:39:55 -0500
Subject: [PATCH] fix(ags): close all when bar isn't found

---
 devices/wim/config/ags/services/pointers.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/devices/wim/config/ags/services/pointers.js b/devices/wim/config/ags/services/pointers.js
index c9159c20..c6911ba4 100644
--- a/devices/wim/config/ags/services/pointers.js
+++ b/devices/wim/config/ags/services/pointers.js
@@ -185,8 +185,8 @@ class Pointers extends Service {
                                window?.closeOnUnfocus === clickStage;
                     });
 
-                    if (pos.x > bar.x && pos.x < bar.x + bar.w &&
-                        pos.y > bar.y && pos.y < bar.y + bar.h) {
+                    if (pos.x > bar?.x && pos.x < bar?.x + bar?.w &&
+                        pos.y > bar?.y && pos.y < bar?.y + bar?.h) {
 
                         // Don't handle clicks when on bar
                         // TODO: make this configurable