Skip to content

Commit

Permalink
Start: if a corrupted file is part of the Recent File List then ignor…
Browse files Browse the repository at this point in the history
…e it
  • Loading branch information
wwmayer committed Oct 11, 2021
1 parent 70ad139 commit bce8c25
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Mod/Start/StartPage/StartPage.py
Expand Up @@ -147,7 +147,11 @@ def getFreeDesktopThumbnail(filename):
files=zfile.namelist()
# check for meta-file if it's really a FreeCAD document
if files[0] == "Document.xml":
doc = str(zfile.read(files[0]))
try:
doc = str(zfile.read(files[0]))
except OSError as e:
print ("Fail to load corrupted FCStd file: '{0}' with this error: {1}".format(filename, str(e)))
return None
doc = doc.replace("\n"," ")
r = re.findall("Property name=\"CreatedBy.*?String value=\"(.*?)\"/>",doc)
if r:
Expand Down

0 comments on commit bce8c25

Please sign in to comment.