IDEA-159850 NPE on welcome screen (Import Project)

This commit is contained in:
Denis Fokin
2016-08-15 18:34:29 +03:00
parent 1f6535ca55
commit 548727ebc5
@@ -31,7 +31,8 @@ import java.awt.*;
public class OwnerOptional {
@NotNull
private static Window findOwnerByComponent(@NotNull Component component) {
private static Window findOwnerByComponent(Component component) {
if (component == null) component = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
return (component instanceof Window) ? (Window) component : SwingUtilities.getWindowAncestor(component);
}