From 348d689243e100f43ec25b6fb08387372d5c75e6 Mon Sep 17 00:00:00 2001 From: Antoine Mercadal Date: Wed, 23 Jan 2013 10:45:09 -0800 Subject: [PATCH] If the targetView of attachedWindow has no more window, close the popover instead of trying to reposition it --- AppKit/_CPAttachedWindow.j | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AppKit/_CPAttachedWindow.j b/AppKit/_CPAttachedWindow.j index cb86bad55..ceba344e3 100644 --- a/AppKit/_CPAttachedWindow.j +++ b/AppKit/_CPAttachedWindow.j @@ -189,6 +189,12 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0, // TODO: don't recompute everything, just compute the move offset var edge = [_windowView preferredEdge]; + if (![_targetView window]) + { + [self _close] + return; + } + [self positionRelativeToRect:nil ofView:_targetView preferredEdge:edge]; } }