From cac585c4e211909fe0409d647da3f27f3a8d9fa7 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Wed, 26 Mar 2014 13:46:39 +0400 Subject: [PATCH] fixed PY-12510 NPE in Idea 13 Python Plugin New Module SDK dialog prevents all python use Component could return null if the Component is not directly under the mouse --- python/src/com/jetbrains/python/sdk/PythonSdkType.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/src/com/jetbrains/python/sdk/PythonSdkType.java b/python/src/com/jetbrains/python/sdk/PythonSdkType.java index b13cb762cae4..e9cd31e265a8 100644 --- a/python/src/com/jetbrains/python/sdk/PythonSdkType.java +++ b/python/src/com/jetbrains/python/sdk/PythonSdkType.java @@ -279,8 +279,9 @@ public class PythonSdkType extends SdkType { public void showCustomCreateUI(SdkModel sdkModel, final JComponent parentComponent, final Consumer sdkCreatedCallback) { Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(parentComponent)); - final Point point = parentComponent.getMousePosition(); - SwingUtilities.convertPointToScreen(point, parentComponent); + final PointerInfo pointerInfo = MouseInfo.getPointerInfo(); + if (pointerInfo == null) return; + final Point point = pointerInfo.getLocation(); PythonSdkDetailsStep .show(project, sdkModel.getSdks(), null, parentComponent, point, new NullableConsumer() { @Override