Merge "Fix possible nullptr dereference."
This commit is contained in:
commit
442544d7b4
1 changed files with 4 additions and 2 deletions
|
@ -90,11 +90,13 @@ void UnwindLog(const std::vector<unwindstack::LocalFrameData>& frame_info) {
|
|||
std::shared_ptr<unwindstack::MapInfo> map_info = info->map_info;
|
||||
|
||||
std::string line = android::base::StringPrintf(" #%0zd pc %" PAD_PTR " ", i, info->rel_pc);
|
||||
if (map_info->offset() != 0) {
|
||||
if (map_info != nullptr && map_info->offset() != 0) {
|
||||
line += android::base::StringPrintf("(offset 0x%" PRIx64 ") ", map_info->offset());
|
||||
}
|
||||
|
||||
if (map_info->name().empty()) {
|
||||
if (map_info == nullptr) {
|
||||
line += "<unknown>";
|
||||
} else if (map_info->name().empty()) {
|
||||
line += android::base::StringPrintf("<anonymous:%" PRIx64 ">", map_info->start());
|
||||
} else {
|
||||
line += map_info->name();
|
||||
|
|
Loading…
Reference in a new issue