Skip to content

Commit f266f9c

Browse files
schmidt-sebastianpaulb777
authored andcommitted
Don't delete apps that don't exist (#276)
1 parent f1c8193 commit f266f9c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Firebase/Database/Api/FIRDatabase.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ + (void)load {
5454
NSMutableDictionary *instances = [self instances];
5555
@synchronized (instances) {
5656
FIRDatabase *deletedApp = instances[appName];
57-
// Clean up the deleted instance in an effort to remove any resources still in use.
58-
// Note: Any leftover instances of this exact database will be invalid.
59-
[FRepoManager disposeRepos:deletedApp.config];
60-
[instances removeObjectForKey:appName];
57+
if (deletedApp) {
58+
// Clean up the deleted instance in an effort to remove any resources still in use.
59+
// Note: Any leftover instances of this exact database will be invalid.
60+
[FRepoManager disposeRepos:deletedApp.config];
61+
[instances removeObjectForKey:appName];
62+
}
6163
}
6264
}];
6365
}

0 commit comments

Comments
 (0)