@@ -327,13 +327,17 @@ def ids_mapping(self, filename: str) -> None:
327
327
328
328
for place_node in root .iter (xmlns + 'place' ):
329
329
place_id = place_node .attrib ['id' ]
330
- place_name = place_node .find (xmlns + 'name/' + xmlns + 'text' ).text .replace ('#' , '.' ).replace (',' , '.' ) # '#' and ',' forbidden in SMT-LIB
331
- self .pnml_places_mapping [place_id ] = place_name
330
+ place_text = place_node .find (xmlns + 'name/' + xmlns + 'text' )
331
+ if place_text is not None :
332
+ place_name = place_text .text .replace ('#' , '.' ).replace (',' , '.' ) # '#' and ',' forbidden in SMT-LIB
333
+ self .pnml_places_mapping [place_id ] = place_name
332
334
333
335
for transition_node in root .iter (xmlns + 'transition' ):
334
336
transition_id = transition_node .attrib ['id' ]
335
- transition_name = transition_node .find (xmlns + 'name/' + xmlns + 'text' ).text .replace ('#' , '.' ).replace (',' , '.' ) # '#' and ',' forbidden in SMT-LIB
336
- self .pnml_transitions_mapping [transition_id ] = transition_name
337
+ transition_text = transition_node .find (xmlns + 'name/' + xmlns + 'text' )
338
+ if transition_text is not None :
339
+ transition_name = transition_text .text .replace ('#' , '.' ).replace (',' , '.' ) # '#' and ',' forbidden in SMT-LIB
340
+ self .pnml_transitions_mapping [transition_id ] = transition_name
337
341
338
342
def parse_net (self , filename : str ) -> None :
339
343
""" Petri net parser.
0 commit comments