Skip to content

Commit 1946984

Browse files
committed
fix: null socket subtype no longer causes issues
1 parent bb4c031 commit 1946984

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

NodeToPython/ntp_operator.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -605,12 +605,13 @@ def _create_socket(self, socket: NodeTreeInterfaceSocket,
605605
f"socket_type = {socket_type}"
606606
f"{optional_parent_str})")
607607

608+
self._set_tree_socket_defaults(socket, socket_var)
609+
608610
# subtype
609611
if hasattr(socket, "subtype"):
610-
subtype = enum_to_py_str(socket.subtype)
611-
self._write(f"{socket_var}.subtype = {subtype}")
612-
613-
self._set_tree_socket_defaults(socket, socket_var)
612+
if socket.subtype != '':
613+
subtype = enum_to_py_str(socket.subtype)
614+
self._write(f"{socket_var}.subtype = {subtype}")
614615

615616
# default attribute name
616617
if socket.default_attribute_name != "":

0 commit comments

Comments
 (0)