@@ -310,6 +310,8 @@ UserExpression::Evaluate(ExecutionContext &exe_ctx,
310
310
target->GetUserExpressionForLanguage (
311
311
fixed_expression->c_str (), full_prefix, language, desired_type,
312
312
options, ctx_obj, error));
313
+ if (!fixed_expression_sp)
314
+ break ;
313
315
DiagnosticManager fixed_diagnostic_manager;
314
316
parse_success = fixed_expression_sp->Parse (
315
317
fixed_diagnostic_manager, exe_ctx, execution_policy,
@@ -318,17 +320,16 @@ UserExpression::Evaluate(ExecutionContext &exe_ctx,
318
320
diagnostic_manager.Clear ();
319
321
user_expression_sp = fixed_expression_sp;
320
322
break ;
323
+ }
324
+ // The fixed expression also didn't parse. Let's check for any new
325
+ // fixits we could try.
326
+ if (!fixed_expression_sp->GetFixedText ().empty ()) {
327
+ *fixed_expression = fixed_expression_sp->GetFixedText ().str ();
321
328
} else {
322
- // The fixed expression also didn't parse. Let's check for any new
323
- // Fix-Its we could try.
324
- if (!fixed_expression_sp->GetFixedText ().empty ()) {
325
- *fixed_expression = fixed_expression_sp->GetFixedText ().str ();
326
- } else {
327
- // Fixed expression didn't compile without a fixit, don't retry and
328
- // don't tell the user about it.
329
- fixed_expression->clear ();
330
- break ;
331
- }
329
+ // Fixed expression didn't compile without a fixit, don't retry and
330
+ // don't tell the user about it.
331
+ fixed_expression->clear ();
332
+ break ;
332
333
}
333
334
}
334
335
}
0 commit comments