Check mMediaProvider for null
Getting the content provider could return null in some cases where the user is locked, so check for that when closing. Bug: 73656609 Test: no crash Change-Id: I607cd2da5348520616a1c171d0d8a1afacabe592
This commit is contained in:
@@ -292,7 +292,9 @@ public class MtpDatabase implements AutoCloseable {
|
||||
mCloseGuard.close();
|
||||
if (mClosed.compareAndSet(false, true)) {
|
||||
mMediaScanner.close();
|
||||
mMediaProvider.close();
|
||||
if (mMediaProvider != null) {
|
||||
mMediaProvider.close();
|
||||
}
|
||||
native_finalize();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user