diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAtomMatchConditionComponent.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAtomMatchConditionComponent.java index 04c0f2dc1726..0c6b6ef4ba81 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAtomMatchConditionComponent.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAtomMatchConditionComponent.java @@ -183,8 +183,8 @@ public class ArrangementAtomMatchConditionComponent implements ArrangementUiComp public void paint(Graphics g) { Rectangle buttonBounds = getCloseButtonScreenBounds(); if (buttonBounds != null) { - Point mouseScreenLocation = MouseInfo.getPointerInfo().getLocation(); - myCloseButtonHovered = buttonBounds.contains(mouseScreenLocation); + final PointerInfo info = MouseInfo.getPointerInfo(); + myCloseButtonHovered = info != null && buttonBounds.contains(info.getLocation()); } Rectangle bounds = getBounds();