IDEA-189500 Search does not work

Avoid NPE when caret field is suddenly null
This commit is contained in:
Vassiliy.Kudryashov
2018-05-31 18:51:02 +03:00
parent 0979a4384a
commit 4f7c5886d0
@@ -206,7 +206,11 @@ public class FindPopupPanel extends JBPanel implements FindUI {
}
showPoint = new RelativePoint(parent, new Point((parent.getSize().width - getPreferredSize().width) / 2, height));
}
mySearchComponent.selectAll();
ApplicationManager.getApplication().invokeLater(() -> {
if (mySearchComponent.getCaret() != null) {
mySearchComponent.selectAll();
}
});
WindowMoveListener windowListener = new WindowMoveListener(this);
myTitlePanel.addMouseListener(windowListener);
myTitlePanel.addMouseMotionListener(windowListener);