From d47b2ba9b6ea959ff1f36bbbae0a2c0e9307c41e Mon Sep 17 00:00:00 2001 From: Jaimos Skriletz Date: Tue, 7 Nov 2023 09:15:58 -0700 Subject: [PATCH] Double check icon exists in fvwm-menu-desktop If xdg wasn't able to find a valid icon, the icon would revert to a string that is not a valid icon path, causing fvwm to return an error. Add one final check to ensure that the icon path exists before using it. --- bin/fvwm-menu-desktop.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/fvwm-menu-desktop.in b/bin/fvwm-menu-desktop.in index 3fd664e09..99794d8de 100644 --- a/bin/fvwm-menu-desktop.in +++ b/bin/fvwm-menu-desktop.in @@ -715,9 +715,10 @@ def printmenu(name, icon, command): iconfile = '' if IconScaleTool.enable_icon: iconfile = geticonfile(icon) or getdefaulticonfile(command) or icon - if not (iconfile == '' or iconfile == None): + if not (iconfile == '' or iconfile == None) and os.path.isfile(iconfile): iconfile = '%'+iconfile+'%' else: + iconfile = '' sys.stderr.write("%s icon or default icon not found!\n") printtext('+ "%s%s" %s' % (escapemenutext(name), iconfile, command))