Skip to content

Commit

Permalink
Merge commit 'a190d147ce89' from swift/release/5.3 into swift/master
Browse files Browse the repository at this point in the history
  • Loading branch information
git apple-llvm automerger committed Jun 24, 2020
2 parents 8d19c42 + a190d14 commit f9957f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lldb/source/Plugins/Language/Swift/SwiftOptional.cpp
Expand Up @@ -221,7 +221,7 @@ lldb::ValueObjectSP lldb_private::formatters::swift::
if (IsEmpty())
return nullptr;
auto child = m_some->GetChildAtIndex(idx, true);
if (m_some->IsSyntheticChildrenGenerated())
if (child && m_some->IsSyntheticChildrenGenerated())
child->SetSyntheticChildrenGenerated(true);
return child;
}
Expand Down
Expand Up @@ -102,4 +102,9 @@ def do_check_api(self):
uoptString_Some,
use_dynamic=False,
num_children=1)
uoptString_Some.GetChildAtIndex(99)

# Querying a non-existing child should not crash.
synth_valobj = self.frame().FindVariable("optString_Some")
synth_valobj.SetSyntheticChildrenGenerated(True);
self.assertEqual(synth_valobj.GetChildAtIndex(1).GetSummary(), None)

0 comments on commit f9957f0

Please sign in to comment.