More Warning fixes

This commit is contained in:
Ly-sec 2025-08-21 15:55:38 +02:00
parent b3972fd862
commit aed728ec9c
2 changed files with 8 additions and 5 deletions

View file

@ -49,8 +49,13 @@ Row {
if (!focusedWindow || !focusedWindow.appId)
return ""
let icon = Quickshell.iconPath(DesktopEntries.byId(focusedWindow.appId).icon)
return icon || ""
// DesktopEntries.byId may return null for unknown apps; guard accordingly
if (typeof DesktopEntries === 'undefined' || !DesktopEntries.byId)
return ""
const entry = DesktopEntries.byId(focusedWindow.appId)
const iconName = entry && entry.icon ? entry.icon : ""
const iconPath = iconName ? Quickshell.iconPath(iconName) : ""
return iconPath || ""
}
// A hidden text element to safely measure the full title width