diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index f40e4bdc3e029..785a3c5ddb2dd 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -661,7 +661,7 @@ status_t Parcel::writeWeakBinder(const wp& val) status_t Parcel::writeNativeHandle(const native_handle* handle) { - if (handle->version != sizeof(native_handle)) + if (!handle || handle->version != sizeof(native_handle)) return BAD_TYPE; status_t err;