aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2017-03-30 00:26:29 +0200
committerMax <post@wickenrode.com>2017-03-30 00:26:29 +0200
commit64929b3d810d8c18367ba869cba726f2360978d1 (patch)
tree34851e3e6e03f7f24b63383acd65e2f00de621a0 /Source
parentfc4b19bb587bf7811b8dbec275d0ba1684a87287 (diff)
downloadsequelpro-64929b3d810d8c18367ba869cba726f2360978d1.tar.gz
sequelpro-64929b3d810d8c18367ba869cba726f2360978d1.tar.bz2
sequelpro-64929b3d810d8c18367ba869cba726f2360978d1.zip
More debug code to find cause of #2266
Diffstat (limited to 'Source')
-rw-r--r--Source/SPDatabaseDocument.m15
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 08b2737d..bc1acb22 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -427,7 +427,10 @@ static int64_t SPDatabaseDocumentInstanceCounter = 0;
#ifndef SP_CODA
// Set the fileURL and init the preferences (query favs, filters, and history) if available for that URL
- [self setFileURL:[[SPQueryController sharedQueryController] registerDocumentWithFileURL:[self fileURL] andContextInfo:spfPreferences]];
+ NSURL *newURL = [[SPQueryController sharedQueryController] registerDocumentWithFileURL:[self fileURL] andContextInfo:spfPreferences];
+#warning debug code for #2266
+ if(!newURL) NSLog(@"#2266: Trying to set nil fileURL in %s from queryController=%@ oldFileURL=%@ contextInfo=%@", __func__, [SPQueryController sharedQueryController], [self fileURL], spfPreferences);
+ [self setFileURL:newURL];
// ...but hide the icon while the document is temporary
if ([self isUntitled]) [[parentWindow standardWindowButton:NSWindowDocumentIconButton] setImage:nil];
@@ -3534,7 +3537,10 @@ static int64_t SPDatabaseDocumentInstanceCounter = 0;
[preferences setObject:[spfStructure objectForKey:SPContentFilters] forKey:SPContentFilters];
[[SPQueryController sharedQueryController] registerDocumentWithFileURL:[NSURL fileURLWithPath:fileName] andContextInfo:preferences];
- [self setFileURL:[NSURL fileURLWithPath:fileName]];
+ NSURL *newURL = [NSURL fileURLWithPath:fileName];
+#warning debug code for #2266
+ if(!newURL) NSLog(@"#2266: Trying to set nil fileURL in %s from fileName=%@", __func__, fileName);
+ [self setFileURL:newURL];
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:[NSURL fileURLWithPath:fileName]];
[self updateWindowTitle:self];
@@ -5088,7 +5094,10 @@ static int64_t SPDatabaseDocumentInstanceCounter = 0;
}
if (![self isSaveInBundle]) {
- [self setFileURL:[NSURL fileURLWithPath:path]];
+ NSURL *newURL = [NSURL fileURLWithPath:path];
+#warning debug code for #2266
+ if(!newURL) NSLog(@"#2266: Trying to set nil fileURL in %s from path=%@", __func__, path);
+ [self setFileURL:newURL];
}
[spfDocData setObject:[NSNumber numberWithBool:([[data objectForKey:@"connection"] objectForKey:@"password"]) ? YES : NO] forKey:@"save_password"];