@@ -177,26 +177,26 @@ static t_wireconn_inf parse_wireconn_inline(pugi::xml_node node,
177
177
parse_num_conns (char_prop, wc);
178
178
179
179
// 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.
182
182
parse_comma_separated_wire_types (char_prop, wc.from_switchpoint_set );
183
183
}
184
184
185
185
// 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 ) {
188
188
parse_comma_separated_wire_types (char_prop, wc.to_switchpoint_set );
189
189
}
190
190
191
191
// 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 ) {
194
194
parse_comma_separated_wire_points (char_prop, wc.from_switchpoint_set );
195
195
}
196
196
197
197
// 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 ) {
200
200
parse_comma_separated_wire_points (char_prop, wc.to_switchpoint_set );
201
201
}
202
202
0 commit comments