Skip to content

Commit c2ca5ee

Browse files
authored
Do not print comment on empty PDO mappings in jsonc file (#73)
1 parent f0bbbd5 commit c2ca5ee

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/objdictgen/jsonod.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,8 @@ def rearrage_for_json(obj: TODObjJson, node: Node, objtypes_i2s: dict[int, str],
730730
name = pdo["name"]
731731
except ValueError:
732732
name = '???'
733-
sub["value"] = f'@@{value} // 0x{value_h[0:4]}_{value_h[4:6]}_{value_h[6:]} {name}@@'
733+
if value:
734+
sub["value"] = f'@@{value} // 0x{value_h[0:4]}_{value_h[4:6]}_{value_h[6:]} {name}@@'
734735

735736
if 'each' in obj:
736737
each = obj["each"]

0 commit comments

Comments
 (0)