From 69c4449c02342a1904de34e2b4bf95358e201fc9 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Thu, 5 Feb 2015 12:35:51 +0300 Subject: [PATCH] IDEA-136004 Some "Find Action.." search queries causes NPE in plugin XPathView + XSLT Support --- .../src/com/intellij/openapi/actionSystem/Presentation.java | 1 + .../src/org/intellij/plugins/xpathView/ShowXPathAction.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/Presentation.java b/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/Presentation.java index f01edcea731e..fdb268da3dc8 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/Presentation.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/Presentation.java @@ -114,6 +114,7 @@ public final class Presentation implements Cloneable { myChangeSupport.removePropertyChangeListener(l); } + @Nullable public String getText(){ return myText; } diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/ShowXPathAction.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/ShowXPathAction.java index 748a7063b200..8739b243f86a 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/ShowXPathAction.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/ShowXPathAction.java @@ -51,7 +51,8 @@ public class ShowXPathAction extends XPathAction { super.update(event); final Presentation presentation = event.getPresentation(); - if (ActionPlaces.isMainMenuOrActionSearch(event.getPlace()) && presentation.getText().startsWith("Show ")) { + String presentationText = presentation.getText(); + if (presentationText != null && ActionPlaces.isMainMenuOrActionSearch(event.getPlace()) && presentationText.startsWith("Show ")) { final String text = presentation.getText().substring("Show ".length()); presentation.setText(Character.toUpperCase(text.charAt(0)) + text.substring(1)); }