Browse Source

Don't crash when a texture is on a disconnected HDD.

pull/172/head
Adam Johnson 4 years ago
parent
commit
6063bf6f2a
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 17
      korman/exporter/image.py

17
korman/exporter/image.py

@ -143,12 +143,17 @@ class ImageCache:
# the string "//". There isn't much we can do with that, unless the user
# happens to have an unpacked copy lying around somewheres...
path = Path(bl_image.filepath_from_user())
if path.is_file():
cached_image.modify_time = path.stat().st_mtime
if cached_image.export_time and cached_image.export_time < cached_image.modify_time:
return None
else:
cached_image.modify_time = 0
try:
exists = path.is_file()
except OSError:
exists = False
finally:
if exists:
cached_image.modify_time = path.stat().st_mtime
if cached_image.export_time and cached_image.export_time < cached_image.modify_time:
return None
else:
cached_image.modify_time = 0
# ensure the data has been loaded from the cache
if cached_image.image_data is None:

Loading…
Cancel
Save