summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index 03821071..f663d337 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -2045,7 +2045,10 @@ vector<Ref<Section>> BinaryView::GetSectionsAt(uint64_t addr)
Ref<Section> BinaryView::GetSectionByName(const string& name)
{
- return new Section(BNGetSectionByName(m_object, name.c_str()));
+ BNSection* section = BNGetSectionByName(m_object, name.c_str());
+ if (section)
+ return new Section(section);
+ return nullptr;
}