Merge "Guard against null server" into pi-dev
am: bb54f62d1a
Change-Id: I6a35fcd7b27e04ae207fafca9f504bfaad174035
This commit is contained in:
@@ -314,7 +314,9 @@ public class MtpDatabase implements AutoCloseable {
|
||||
public void addStorage(StorageVolume storage) {
|
||||
MtpStorage mtpStorage = mManager.addMtpStorage(storage);
|
||||
mStorageMap.put(storage.getPath(), mtpStorage);
|
||||
mServer.addStorage(mtpStorage);
|
||||
if (mServer != null) {
|
||||
mServer.addStorage(mtpStorage);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeStorage(StorageVolume storage) {
|
||||
@@ -322,7 +324,9 @@ public class MtpDatabase implements AutoCloseable {
|
||||
if (mtpStorage == null) {
|
||||
return;
|
||||
}
|
||||
mServer.removeStorage(mtpStorage);
|
||||
if (mServer != null) {
|
||||
mServer.removeStorage(mtpStorage);
|
||||
}
|
||||
mManager.removeMtpStorage(mtpStorage);
|
||||
mStorageMap.remove(storage.getPath());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user