Merge "Fix broken readNullableStrongBinder<T> implementation"
diff --git a/include/binder/Parcel.h b/include/binder/Parcel.h
index 97a3376..cdf3584 100644
--- a/include/binder/Parcel.h
+++ b/include/binder/Parcel.h
@@ -586,10 +586,12 @@
     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>