@@ -510,22 +510,32 @@ def _on_reco_node_ended(self):
510510 )
511511
512512 def _on_next_list_starting (
513- self , current : str , next_list : List [str ], anchor_flags : List [bool ] = []
513+ self ,
514+ current : str ,
515+ next_list : List [str ],
516+ anchor_flags : Optional [List [bool ]] = None ,
514517 ):
515518 """处理 NextList 开始事件"""
516519 self .row_len += 1
517520
521+ normalized_anchor_flags = anchor_flags or []
522+
518523 # 从 pipeline 的 next 列表中提取 [Anchor] 标记,得到锚点名和目标节点
519524 anchor_names : List [str ] = []
520525 anchor_targets : List [str ] = []
521- if any (anchor_flags ):
526+ if any (normalized_anchor_flags ):
522527 node_data = maafw .get_node_data (current )
523- node_next = node_data .get ("next" , [])
524- anchor_map = (
525- node_data .get ("anchor" , {}) if isinstance (node_data , dict ) else {}
526- )
528+ if isinstance (node_data , dict ):
529+ node_next = node_data .get ("next" , [])
530+ anchor_map = node_data .get ("anchor" , {})
531+ else :
532+ node_next = []
533+ anchor_map = {}
534+
527535 for i , _name in enumerate (next_list ):
528- is_anchor = i < len (anchor_flags ) and anchor_flags [i ]
536+ is_anchor = (
537+ i < len (normalized_anchor_flags ) and normalized_anchor_flags [i ]
538+ )
529539 if not is_anchor :
530540 anchor_names .append ("" )
531541 anchor_targets .append ("" )
@@ -560,7 +570,12 @@ def _on_next_list_starting(
560570 anchor_targets = ["" ] * len (next_list )
561571
562572 list_data = ListData (
563- self .row_len , current , next_list , anchor_flags , anchor_names , anchor_targets
573+ self .row_len ,
574+ current ,
575+ next_list ,
576+ normalized_anchor_flags ,
577+ anchor_names ,
578+ anchor_targets ,
564579 )
565580 self .add_list_data (list_data )
566581
0 commit comments