Skip to content

Commit 25f8aa8

Browse files
committed
Add missing nullptr check.
rdar://77562485
1 parent 8463f2a commit 25f8aa8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,15 @@ static CompilerType GetSwiftTypeForVariableValueObject(
449449
SwiftLanguageRuntime *runtime) {
450450
// Check that the passed ValueObject is valid.
451451
if (!valobj_sp || valobj_sp->GetError().Fail())
452-
return CompilerType();
452+
return {};
453453
CompilerType result = valobj_sp->GetCompilerType();
454-
if (!result.IsValid())
455-
return CompilerType();
454+
if (!result)
455+
return {};
456456
result = runtime->BindGenericTypeParameters(*stack_frame_sp, result);
457+
if (!result)
458+
return {};
457459
if (!result.GetTypeSystem()->SupportsLanguage(lldb::eLanguageTypeSwift))
458-
return CompilerType();
460+
return {};
459461
return result;
460462
}
461463

0 commit comments

Comments
 (0)