Skip to content

Commit 6d0a38b

Browse files
committed
Only output expected port if it exists
1 parent a40bc55 commit 6d0a38b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python_tools/json_util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,9 @@ def _processClass(self, cls):
361361
constructor_data[_KEY_FUNCTION_DECLARING_CLASS_NAME] = declaring_class_name
362362
constructor_data[_KEY_FUNCTION_RETURN_TYPE] = declaring_class_name
363363
# This is where I check to see if
364-
constructor_data[_KEY_PORT_EXPECTED_TYPE] = python_util.getPortTypeFromConstructor(value)
364+
expectedPortType = python_util.getPortTypeFromConstructor(value)
365+
if expectedPortType:
366+
constructor_data[_KEY_PORT_EXPECTED_TYPE] = python_util.getPortTypeFromConstructor(value)
365367

366368
constructors.append(constructor_data)
367369
class_data[_KEY_CONSTRUCTORS] = constructors

0 commit comments

Comments
 (0)