File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
source/Plugins/Language/Swift
test/API/lang/swift/variables/optionals Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ lldb::ValueObjectSP lldb_private::formatters::swift::
221
221
if (IsEmpty ())
222
222
return nullptr ;
223
223
auto child = m_some->GetChildAtIndex (idx, true );
224
- if (m_some->IsSyntheticChildrenGenerated ())
224
+ if (child && m_some->IsSyntheticChildrenGenerated ())
225
225
child->SetSyntheticChildrenGenerated (true );
226
226
return child;
227
227
}
Original file line number Diff line number Diff line change @@ -102,4 +102,9 @@ def do_check_api(self):
102
102
uoptString_Some ,
103
103
use_dynamic = False ,
104
104
num_children = 1 )
105
+ uoptString_Some .GetChildAtIndex (99 )
105
106
107
+ # Querying a non-existing child should not crash.
108
+ synth_valobj = self .frame ().FindVariable ("optString_Some" )
109
+ synth_valobj .SetSyntheticChildrenGenerated (True );
110
+ self .assertEqual (synth_valobj .GetChildAtIndex (1 ).GetSummary (), None )
You can’t perform that action at this time.
0 commit comments