Skip to content

Commit

Permalink
Merge pull request godotengine#309 from Ben1138/fix_node_tree_crash
Browse files Browse the repository at this point in the history
Fix crash for potential non existent texture images.
  • Loading branch information
Jason0214 committed Feb 9, 2020
2 parents a123e7a + 43d2578 commit 8108812
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,10 @@ def export_texture(escn_file, export_settings, image):
else:
src_path = image.filepath_raw
if os.path.normpath(src_path) != os.path.normpath(dst_path):
copyfile(src_path, dst_path)
if not os.path.exists(src_path):
logging.warning("Texture Image '%s' does not exist!", src_path)
else:
copyfile(src_path, dst_path)

img_resource = ExternalResource(dst_path, "Texture")
return escn_file.add_external_resource(img_resource, image)
Expand Down

0 comments on commit 8108812

Please sign in to comment.