diff options
author | Max <post@wickenrode.com> | 2016-01-13 18:58:32 +0100 |
---|---|---|
committer | Max <post@wickenrode.com> | 2016-01-13 18:58:32 +0100 |
commit | 1a957e11c461bfdabf2376488dadf6be293d97d1 (patch) | |
tree | 90375b40745b8220c4b11f593c91ace26e215330 | |
parent | d6087f3e45cb67b57b96df24fbdee4a2995d5825 (diff) | |
download | sequelpro-1a957e11c461bfdabf2376488dadf6be293d97d1.tar.gz sequelpro-1a957e11c461bfdabf2376488dadf6be293d97d1.tar.bz2 sequelpro-1a957e11c461bfdabf2376488dadf6be293d97d1.zip |
Avoid an exception on a rare issue where determing the database fails after sql import/running a custom query
-rw-r--r-- | Source/SPDatabaseDocument.m | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 3542a269..62fe2357 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -1149,7 +1149,8 @@ static int64_t SPDatabaseDocumentInstanceCounter = 0; dbName = NSArrayObjectAtIndex(eachRow, 0); } - if(![dbName isNSNull]) { + // TODO: there have been crash reports because dbName == nil at this point. When could that happen? + if(dbName && ![dbName isNSNull]) { if(![dbName isEqualToString:selectedDatabase]) { if (selectedDatabase) SPClear(selectedDatabase); selectedDatabase = [[NSString alloc] initWithString:dbName]; |