From 42fa109992374fa568dbeefd39605eea14c376a0 Mon Sep 17 00:00:00 2001 From: retrozinndev Date: Sat, 17 May 2025 18:57:24 -0300 Subject: [PATCH] :boom: ags(scripts/apps): null-check before searching for icon --- ags/scripts/apps.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ags/scripts/apps.ts b/ags/scripts/apps.ts index 2d1cb7b..19a8820 100644 --- a/ags/scripts/apps.ts +++ b/ags/scripts/apps.ts @@ -36,6 +36,8 @@ export function getAppsByName(appName: string): (Array|un } export function getIconByAppName(appName: string): (string|undefined) { + if(!appName) return undefined; + if(Astal.Icon.lookup_icon(appName)) return appName; @@ -54,6 +56,8 @@ export function getIconByAppName(appName: string): (string|undefined) { } export function getAppIcon(app: (string|AstalApps.Application)): (string|undefined) { + if(!app) return undefined; + if(typeof app === "string") return getIconByAppName(app);