Fix null-pointer template apply (EA-102391)
This commit is contained in:
+2
-2
@@ -38,8 +38,8 @@ internal class AnonymousTemplateEditingListener(private val psiFile: PsiFile, pr
|
|||||||
private var classRef: KtReferenceExpression? = null
|
private var classRef: KtReferenceExpression? = null
|
||||||
private var classDescriptor: ClassDescriptor? = null
|
private var classDescriptor: ClassDescriptor? = null
|
||||||
|
|
||||||
override fun currentVariableChanged(templateState: TemplateState?, template: Template?, oldIndex: Int, newIndex: Int) {
|
override fun currentVariableChanged(templateState: TemplateState, template: Template?, oldIndex: Int, newIndex: Int) {
|
||||||
assert(templateState!!.template != null)
|
if (templateState.template == null) return
|
||||||
val variableRange = templateState.getVariableRange("SUPERTYPE") ?: return
|
val variableRange = templateState.getVariableRange("SUPERTYPE") ?: return
|
||||||
val name = psiFile.findElementAt(variableRange.startOffset)
|
val name = psiFile.findElementAt(variableRange.startOffset)
|
||||||
if (name != null && name.parent is KtReferenceExpression) {
|
if (name != null && name.parent is KtReferenceExpression) {
|
||||||
|
|||||||
Reference in New Issue
Block a user