IDEA-136004 Some "Find Action.." search queries causes NPE in plugin XPathView + XSLT Support

This commit is contained in:
Dmitry Avdeev
2015-02-05 12:46:37 +03:00
parent 8c911cab80
commit 69c4449c02
2 changed files with 3 additions and 1 deletions
@@ -114,6 +114,7 @@ public final class Presentation implements Cloneable {
myChangeSupport.removePropertyChangeListener(l);
}
@Nullable
public String getText(){
return myText;
}
@@ -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));
}