From fb4ed54a3d19cecd56eea004b063afddf757baec Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Mon, 9 Jul 2012 19:16:04 +0400 Subject: [PATCH] IDEA-66333 Quick documentation lookup on mouse hover No more NPE here --- .../documentation/QuickDocOnMouseOverManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/QuickDocOnMouseOverManager.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/QuickDocOnMouseOverManager.java index be88c67528b0..82da337ffdd4 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/QuickDocOnMouseOverManager.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/QuickDocOnMouseOverManager.java @@ -169,10 +169,14 @@ public class QuickDocOnMouseOverManager { // Skip the event if the control is shown because of explicit 'show quick doc' action call. WeakReference ref = myDocumentationManager; - if (ref == null || ref.get() == null || !ref.get().isCloseOnSneeze()) { + if (ref == null) { return; } - + DocumentationManager manager = ref.get(); + if (manager == null || !manager.isCloseOnSneeze()) { + return; + } + // Skip the event if the mouse is under the opened quick doc control. Point hintLocation = hint.getLocationOnScreen(); Dimension hintSize = hint.getSize();