Skip to content

Commit 28185f7

Browse files
Merge pull request #4048 from adrian-prantl/clangimporter-null
add missing nullptr checks
2 parents 1b832ee + 8809e49 commit 28185f7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8096,9 +8096,11 @@ static swift::ModuleDecl *LoadOneModule(const SourceModule &module,
80968096
swift::ModuleDecl *swift_module = nullptr;
80978097
lldb::StackFrameSP this_frame_sp(stack_frame_wp.lock());
80988098

8099+
auto *clangimporter = swift_ast_context.GetClangImporter();
80998100
swift::ModuleDecl *imported_header_module =
8100-
swift_ast_context.GetClangImporter()->getImportedHeaderModule();
8101-
if (toplevel.GetStringRef() == imported_header_module->getName().str())
8101+
clangimporter ? clangimporter->getImportedHeaderModule() : nullptr;
8102+
if (imported_header_module &&
8103+
toplevel.GetStringRef() == imported_header_module->getName().str())
81028104
swift_module = imported_header_module;
81038105
else if (this_frame_sp) {
81048106
lldb::ProcessSP process_sp(this_frame_sp->CalculateProcess());

0 commit comments

Comments
 (0)