diff options
| -rw-r--r-- | include/binder/Parcel.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/binder/Parcel.h b/include/binder/Parcel.h index 97a3376c81..cdf358420a 100644 --- a/include/binder/Parcel.h +++ b/include/binder/Parcel.h @@ -586,10 +586,12 @@ status_t Parcel::readNullableStrongBinder(sp<T>* val) const { if (ret == OK) { *val = interface_cast<T>(tmp); - if (val->get() == nullptr) { - return UNKNOWN_ERROR; + if (val->get() == nullptr && tmp.get() != nullptr) { + ret = UNKNOWN_ERROR; } } + + return ret; } template<typename T, typename U> |