aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase/Database
diff options
context:
space:
mode:
authorGravatar Sebastian Schmidt <mrschmidt@google.com>2017-09-15 12:11:33 -0700
committerGravatar GitHub <noreply@github.com>2017-09-15 12:11:33 -0700
commitf0442122d37dd0918655af97c0ee8a113b158d99 (patch)
tree7a9e6c4bb6caf2dd4b2e004e20688f43cda8be5e /Firebase/Database
parentcfef233f3953b644642fbffc8b0e61acab883b9f (diff)
Don't delete apps that don't exist (#276)
Diffstat (limited to 'Firebase/Database')
-rw-r--r--Firebase/Database/Api/FIRDatabase.m10
1 files changed, 6 insertions, 4 deletions
diff --git a/Firebase/Database/Api/FIRDatabase.m b/Firebase/Database/Api/FIRDatabase.m
index 1fd25d5..2dd77f6 100644
--- a/Firebase/Database/Api/FIRDatabase.m
+++ b/Firebase/Database/Api/FIRDatabase.m
@@ -54,10 +54,12 @@ static const char *FIREBASE_SEMVER = (const char *)STR(FIRDatabase_VERSION);
NSMutableDictionary *instances = [self instances];
@synchronized (instances) {
FIRDatabase *deletedApp = instances[appName];
- // Clean up the deleted instance in an effort to remove any resources still in use.
- // Note: Any leftover instances of this exact database will be invalid.
- [FRepoManager disposeRepos:deletedApp.config];
- [instances removeObjectForKey:appName];
+ if (deletedApp) {
+ // Clean up the deleted instance in an effort to remove any resources still in use.
+ // Note: Any leftover instances of this exact database will be invalid.
+ [FRepoManager disposeRepos:deletedApp.config];
+ [instances removeObjectForKey:appName];
+ }
}
}];
}