Permalink
Browse files

Fix first responder exception being logged on 10.12. Check if the fav…

…ourites outline view is attached to a window before setting it as the first responder.
  • Loading branch information...
stuconnolly committed Mar 30, 2017
1 parent db0335a commit 9527a670cf2ea0f05312a09bd4def0721254e0ae
Showing with 9 additions and 6 deletions.
  1. +9 −6 Source/SPDatabaseDocument.m
@@ -4468,6 +4468,7 @@ - (void)tabDidResize
{
// Coax the main split view into actually checking its constraints
[contentViewSplitter setPosition:[[[contentViewSplitter subviews] objectAtIndex:0] bounds].size.width ofDividerAtIndex:0];
// If the task interface is visible, and this tab is frontmost, re-center the task child window
if (_isWorkingLevel && [parentWindowController selectedTableDocument] == self) [self centerTaskWindow];
}
@@ -4476,17 +4477,19 @@ - (void)tabDidResize
/**
* Set the parent window
*/
- (void)setParentWindow:(NSWindow *)aWindow
- (void)setParentWindow:(NSWindow *)window
{
#ifndef SP_CODA
NSWindow *outlineViewWindow = [(NSView *)[connectionController favoritesOutlineView] window];
// If the window is being set for the first time - connection controller is visible - update focus
if (!parentWindow && !mySQLConnection) {
[aWindow makeFirstResponder:(NSResponder *)[connectionController favoritesOutlineView]];
if (!parentWindow && !mySQLConnection && window == outlineViewWindow) {
[window makeFirstResponder:(NSResponder *)[connectionController favoritesOutlineView]];
}
#endif
parentWindow = aWindow;
parentWindow = window;
SPSSHTunnel *currentTunnel = [connectionController valueForKeyPath:@"sshTunnel"];
if (currentTunnel) [currentTunnel setParentWindow:parentWindow];
}

0 comments on commit 9527a67

Please sign in to comment.