File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,7 +117,14 @@ def finalize():
117117 warnings .append (f"Node { node_id } has no label" )
118118 except Exception as e :
119119 warnings .append (f"Error parsing node: { str (e )} " )
120-
120+
121+ # duplicate labels cause silent corruption in mkconcore.py (#384)
122+ seen = set ()
123+ for label in node_labels :
124+ if label in seen :
125+ errors .append (f"Duplicate node label: '{ label } '" )
126+ seen .add (label )
127+
121128 node_ids = {node .get ('id' ) for node in nodes if node .get ('id' )}
122129 for edge in edges :
123130 source = edge .get ('source' )
Original file line number Diff line number Diff line change @@ -307,6 +307,12 @@ def cleanup_script_files():
307307 except (IndexError , AttributeError ):
308308 logging .debug ('A node with no valid properties encountered and ignored' )
309309
310+ label_values = list (nodes_dict .values ())
311+ duplicates = {label for label in label_values if label_values .count (label ) > 1 }
312+ if duplicates :
313+ logging .error (f"Duplicate node labels found: { sorted (duplicates )} " )
314+ quit ()
315+
310316for edge in edges_text :
311317 try :
312318 data = edge .find ('data' , recursive = False )
You can’t perform that action at this time.
0 commit comments