summaryrefslogtreecommitdiff
path: root/simpleperf/dso.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2018-05-30 16:37:06 -0700
committerYabin Cui <yabinc@google.com>2018-05-30 16:37:06 -0700
commit15749e0edc083ca9d4a6e6ac15b75978a9682731 (patch)
treed04924e1f5307dc2ac499e7c506849fc9b0fcaa5 /simpleperf/dso.cpp
parent600eab5ee11b692c8c35a616b7a4e2c4397487b9 (diff)
downloadextras-15749e0edc083ca9d4a6e6ac15b75978a9682731.tar.gz
simpleperf: add a missing null check.
Bug: none. Test: run simpleperf_unit_test. Change-Id: I206c9c67cd96025956246c1bd080653f532a9112
Diffstat (limited to 'simpleperf/dso.cpp')
-rw-r--r--simpleperf/dso.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/simpleperf/dso.cpp b/simpleperf/dso.cpp
index f1804000..223866d0 100644
--- a/simpleperf/dso.cpp
+++ b/simpleperf/dso.cpp
@@ -349,7 +349,8 @@ class DexFileDso : public Dso {
std::unique_ptr<ArchiveHelper> ahelper = ArchiveHelper::CreateInstance(std::get<1>(tuple));
ZipEntry entry;
std::vector<uint8_t> data;
- if (ahelper->FindEntry(std::get<2>(tuple), &entry) && ahelper->GetEntryData(entry, &data)) {
+ if (ahelper &&
+ ahelper->FindEntry(std::get<2>(tuple), &entry) && ahelper->GetEntryData(entry, &data)) {
status = ReadSymbolsFromDexFileInMemory(data.data(), data.size(), dex_file_offsets_,
&dex_file_symbols);
}