Browse Source

Fix potential Python File Node upgrade crash

pull/133/head
Adam Johnson 6 years ago
parent
commit
a3ed2f0178
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 3
      korman/nodes/node_python.py

3
korman/nodes/node_python.py

@ -370,8 +370,11 @@ class PlasmaPythonFileNode(PlasmaVersionedNode, bpy.types.Node):
text_id = bpy.data.texts.get(self.filename, None) text_id = bpy.data.texts.get(self.filename, None)
if text_id is None: if text_id is None:
path = Path(self.filepath) path = Path(self.filepath)
try:
if path.exists(): if path.exists():
text_id = bpy.data.texts.load(self.filepath) text_id = bpy.data.texts.load(self.filepath)
except OSError:
pass
with self.NoUpdate(): with self.NoUpdate():
self.text_id = text_id self.text_id = text_id
self.property_unset("filepath") self.property_unset("filepath")

Loading…
Cancel
Save