Skip to content

Commit

Permalink
Double check icon exists in fvwm-menu-desktop
Browse files Browse the repository at this point in the history
  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.
  • Loading branch information
somiaj authored and ThomasAdam committed Nov 7, 2023
1 parent df6544e commit d47b2ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/fvwm-menu-desktop.in
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit d47b2ba

Please sign in to comment.