💥 ags(scripts/apps): null-check before searching for icon

This commit is contained in:
retrozinndev
2025-05-17 18:57:24 -03:00
parent e1f65fe45d
commit 42fa109992
+4
View File
@@ -36,6 +36,8 @@ export function getAppsByName(appName: string): (Array<AstalApps.Application>|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);