[Bugfix] Prevent start page loading to fail if WB doesn't define an icon

This commit is contained in:
0penBrain
2022-05-02 14:30:24 +02:00
parent e8c8c335d4
commit 6ab0ba073d

View File

@@ -483,7 +483,7 @@ def handle():
img = os.path.join(FreeCAD.getResourceDir(),"Mod",wn,"Resources","icons",wn+"Workbench.svg")
if not os.path.exists(img):
w = FreeCADGui.listWorkbenches()[wb]
if hasattr(w,"Icon"):
if hasattr(w,"Icon") and w.Icon:
xpm = w.Icon
if "XPM" in xpm:
xpm = xpm.replace("\n ","\n") # some XPMs have some indent that QT doesn't like