From 0083091ea10ad1660e35cde44b2af3946a7477f4 Mon Sep 17 00:00:00 2001 From: Noah <37805707+Curve@users.noreply.github.com> Date: Thu, 18 Apr 2024 08:46:44 +0200 Subject: [PATCH] refactor: handle `undefined` in `Object.keys` Co-authored-by: V --- src/renderer/patches/hideSwitchDevice.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/patches/hideSwitchDevice.tsx b/src/renderer/patches/hideSwitchDevice.tsx index 5c87d28..f3acce2 100644 --- a/src/renderer/patches/hideSwitchDevice.tsx +++ b/src/renderer/patches/hideSwitchDevice.tsx @@ -18,6 +18,6 @@ addPatch({ ], shouldIgnore(state: any) { - return Object.keys(state?.default?.lastDeviceConnected)?.[0] === "vencord-screen-share"; + return Object.keys(state?.default?.lastDeviceConnected ?? {})?.[0] === "vencord-screen-share"; } });