Merge "Parcel: Avoid NPE in finalization" am: b085deece9

am: cb34bdf55c

Change-Id: Idd444cd9dfe78d4200f67a4fe6b3c4fb13767f29
This commit is contained in:
Andreas Gampe
2017-10-10 17:52:50 +00:00
committed by android-build-merger

View File

@@ -737,7 +737,9 @@ public class ParcelFileDescriptor implements Parcelable, Closeable {
private void closeWithStatus(int status, String msg) {
if (mClosed) return;
mClosed = true;
mGuard.close();
if (mGuard != null) {
mGuard.close();
}
// Status MUST be sent before closing actual descriptor
writeCommStatusAndClose(status, msg);
IoUtils.closeQuietly(mFd);