From 15a16500e50579777a8bff757fd9fc1830bb1e61 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 15 Sep 2018 17:17:48 -0400 Subject: [PATCH] Fix issue with python files on dead HDDs --- korman/nodes/node_python.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/korman/nodes/node_python.py b/korman/nodes/node_python.py index 44135a4..60f3583 100644 --- a/korman/nodes/node_python.py +++ b/korman/nodes/node_python.py @@ -202,10 +202,13 @@ class PlasmaPythonFileNode(PlasmaNodeBase, bpy.types.Node): row = layout.row(align=True) if self.filename: row.prop(self, "filename") - if Path(self.filepath).exists(): - operator = row.operator("node.plasma_attributes_to_node", icon="FILE_REFRESH", text="") - operator.python_path = self.filepath - operator.node_path = self.node_path + try: + if Path(self.filepath).exists(): + operator = row.operator("node.plasma_attributes_to_node", icon="FILE_REFRESH", text="") + operator.python_path = self.filepath + operator.node_path = self.node_path + except OSError: + pass op_text = "" if self.filename else "Select" operator = row.operator("file.plasma_file_picker", icon="SCRIPT", text=op_text)