diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 410ad5da9..950d16a4f 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -735,7 +735,7 @@ status_t Surface::writeToParcel( sp Surface::readFromParcel(const Parcel& data) { sp binder(data.readStrongBinder()); sp bp(interface_cast(binder)); - return new Surface(bp); + return bp != NULL ? new Surface(bp): NULL; } // ----------------------------------------------------------------------------