Merge "Parcel: Avoid NPE in finalization"

This commit is contained in:
Treehugger Robot
2017-10-10 17:20:56 +00:00
committed by Gerrit Code Review

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);