From 12eb4ef37a945a5d8b85ddf0a376f7eaeae703b1 Mon Sep 17 00:00:00 2001 From: xiexed Date: Wed, 16 Aug 2017 17:47:40 +0300 Subject: [PATCH] `KotlinUastLanguagePlugin#convertElementWithParent` NPE fix when parent is null (#1247) --- .../src/org/jetbrains/uast/kotlin/KotlinUastLanguagePlugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinUastLanguagePlugin.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinUastLanguagePlugin.kt index a7267f4eefd..d67cb9cc1f4 100644 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinUastLanguagePlugin.kt +++ b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinUastLanguagePlugin.kt @@ -74,8 +74,8 @@ class KotlinUastLanguagePlugin : UastLanguagePlugin { val parentUnwrapped = KotlinConverter.unwrapElements(parent) ?: return null if (parent is KtValueArgument && parentUnwrapped is KtAnnotationEntry) { val argumentName = parent.getArgumentName()?.asName?.asString() ?: "" - return (convertElementWithParent(parentUnwrapped, null) as UAnnotation) - .attributeValues.find { it.name == argumentName } + return (convertElementWithParent(parentUnwrapped, null) as? UAnnotation) + ?.attributeValues?.find { it.name == argumentName } } else return convertElementWithParent(parentUnwrapped, null)