@@ -177,26 +177,26 @@ static t_wireconn_inf parse_wireconn_inline(pugi::xml_node node,
177177 parse_num_conns (char_prop, wc);
178178
179179 // get from type
180- char_prop = get_attribute (node, " from_type" , loc_data, from_to_required).value ();
181- if (!can_skip_from_or_to ) {
180+ char_prop = get_attribute (node, " from_type" , loc_data, from_to_required).as_string ();
181+ if (*char_prop ) { // if from_to_required is ReqOpt::REQUIRED, char_prop is definitely not null. Otherwise, it's optional and should be null checked.
182182 parse_comma_separated_wire_types (char_prop, wc.from_switchpoint_set );
183183 }
184184
185185 // get to type
186- char_prop = get_attribute (node, " to_type" , loc_data, from_to_required).value ();
187- if (!can_skip_from_or_to ) {
186+ char_prop = get_attribute (node, " to_type" , loc_data, from_to_required).as_string ();
187+ if (*char_prop ) {
188188 parse_comma_separated_wire_types (char_prop, wc.to_switchpoint_set );
189189 }
190190
191191 // get the source wire point
192- char_prop = get_attribute (node, " from_switchpoint" , loc_data, from_to_required).value ();
193- if (!can_skip_from_or_to ) {
192+ char_prop = get_attribute (node, " from_switchpoint" , loc_data, from_to_required).as_string ();
193+ if (*char_prop ) {
194194 parse_comma_separated_wire_points (char_prop, wc.from_switchpoint_set );
195195 }
196196
197197 // get the destination wire point
198- char_prop = get_attribute (node, " to_switchpoint" , loc_data, from_to_required).value ();
199- if (!can_skip_from_or_to ) {
198+ char_prop = get_attribute (node, " to_switchpoint" , loc_data, from_to_required).as_string ();
199+ if (*char_prop ) {
200200 parse_comma_separated_wire_points (char_prop, wc.to_switchpoint_set );
201201 }
202202
0 commit comments