Check handle for nullptr
Test: pass
Bug: 37662706
Change-Id: I12ab30134c8c9d04f1020dc44788a63fd77a6570
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index 571d368..cb487aa 100644
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -111,7 +111,7 @@
// Methods from ::android::hardware::dumpstate::V1_0::IDumpstateDevice follow.
Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
- if (handle->numFds < 1) {
+ if (handle == nullptr || handle->numFds < 1) {
ALOGE("no FDs\n");
return Void();
}