Introduce Variable: Fix NPE for the case of statement-like expression
#KT-8054 Fixed
This commit is contained in:
+2
-2
@@ -37,7 +37,7 @@ import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
|
||||
import java.awt.BorderLayout
|
||||
|
||||
public abstract class AbstractKotlinInplaceIntroducer<D: JetNamedDeclaration>(
|
||||
expression: JetExpression,
|
||||
expression: JetExpression?,
|
||||
occurrences: Array<JetExpression>,
|
||||
title: String,
|
||||
project: Project,
|
||||
@@ -58,7 +58,7 @@ public abstract class AbstractKotlinInplaceIntroducer<D: JetNamedDeclaration>(
|
||||
stopIntroduce(myEditor)
|
||||
myProject.executeWriteCommand(getCommandName(), getCommandName(), action)
|
||||
// myExprMarker was invalidated by stopIntroduce()
|
||||
myExprMarker = createMarker(myExpr)
|
||||
myExprMarker = myExpr?.let { createMarker(it) }
|
||||
startInplaceIntroduceTemplate()
|
||||
}
|
||||
finally {
|
||||
|
||||
-1
@@ -206,7 +206,6 @@ public class KotlinIntroduceVariableHandler extends KotlinIntroduceHandlerBase {
|
||||
expression, suggestedNames, allReplaces, commonContainer,
|
||||
commonParent, replaceOccurrence, propertyRef, references,
|
||||
reference, finalNoTypeInference, expressionType, bindingContext);
|
||||
final boolean finalReplaceOccurrence = replaceOccurrence;
|
||||
CommandProcessor.getInstance().executeCommand(project, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ import java.awt.BorderLayout
|
||||
|
||||
public class KotlinVariableInplaceIntroducer(
|
||||
val addedVariable: JetProperty,
|
||||
val originalExpression: JetExpression,
|
||||
val originalExpression: JetExpression?,
|
||||
val occurrencesToReplace: Array<JetExpression>,
|
||||
val suggestedNames: Array<out String>,
|
||||
val isVar: Boolean,
|
||||
|
||||
Reference in New Issue
Block a user