summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2018-05-15 11:59:43 -0400
committerPeter LaFosse <peter@vector35.com>2018-05-15 11:59:43 -0400
commitd0c07251a780ca3b638b2cdff0afa00c92aea421 (patch)
treef836fd06ccc59a57c135561922c33380adcdbdba /binaryview.cpp
parent0094fe08a8f8fbb51c787a358494893391b11654 (diff)
Fix bug that caused null m_object pointer
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;
}