Skip to content

Commit 1e03a7b

Browse files
NerixyzMichael137
andauthored
fix: check if non-synthetic exists
Co-authored-by: Michael Buch <michaelbuch12@gmail.com>
1 parent 0e6da64 commit 1e03a7b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lldb/source/Plugins/Language/CPlusPlus/MsvcStlSmartPointer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
using namespace lldb;
1616

1717
bool lldb_private::formatters::IsMsvcStlSmartPointer(ValueObject &valobj) {
18-
ValueObjectSP valobj_sp = valobj.GetNonSyntheticValue();
19-
return valobj_sp->GetChildMemberWithName("_Ptr") != nullptr;
18+
if (auto valobj_sp = valobj.GetNonSyntheticValue())
19+
return valobj_sp->GetChildMemberWithName("_Ptr") != nullptr;
20+
21+
return false;
2022
}
2123

2224
bool lldb_private::formatters::MsvcStlSmartPointerSummaryProvider(

0 commit comments

Comments
 (0)