From cc397a4a7c4f2a5246554539842aa6000e36d528 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Wed, 14 Jan 2009 13:46:28 +0300 Subject: [PATCH] IDEADEV-33934 --- .../rename/inplace/VariableInplaceRenamer.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/refactoring/impl/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java b/refactoring/impl/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java index ce947b71725d..7d50e0528da9 100644 --- a/refactoring/impl/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java +++ b/refactoring/impl/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java @@ -156,13 +156,16 @@ public class VariableInplaceRenamer { finish(); if (snapshot != null) { - final String newName = templateState.getVariableValue(PRIMARY_VARIABLE_NAME).toString(); - if (JavaPsiFacade.getInstance(myProject).getNameHelper().isIdentifier(newName)) { - ApplicationManager.getApplication().runWriteAction(new Runnable() { - public void run() { - snapshot.apply(newName); - } - }); + TextResult value = templateState.getVariableValue(PRIMARY_VARIABLE_NAME); + if (value != null) { + final String newName = value.toString(); + if (JavaPsiFacade.getInstance(myProject).getNameHelper().isIdentifier(newName)) { + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run() { + snapshot.apply(newName); + } + }); + } } } }