mem_map_test: perform null check before dereferencing a pointer.
Bug: 26635783
Change-Id: I0bd29445b322b4c16b4f85a5acd9fac403d4fb6b
diff --git a/runtime/mem_map_test.cc b/runtime/mem_map_test.cc
index edcbcf2..2f903c8 100644
--- a/runtime/mem_map_test.cc
+++ b/runtime/mem_map_test.cc
@@ -271,8 +271,8 @@
break;
}
}
- ASSERT_GE(reinterpret_cast<uintptr_t>(map->End()), 2u * GB);
ASSERT_TRUE(map.get() != nullptr) << error_msg;
+ ASSERT_GE(reinterpret_cast<uintptr_t>(map->End()), 2u * GB);
ASSERT_TRUE(error_msg.empty());
ASSERT_EQ(BaseBegin(map.get()), reinterpret_cast<void*>(start_addr));
}