From 26b065a2cfadf500f0b37f051675eebdcda00253 Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Fri, 10 Jul 2020 00:57:03 +0000 Subject: Fix NPE --- .../kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/base/src/main/kotlin') diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 5e03be6e..d426d41b 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -435,10 +435,10 @@ class DefaultPsiToDocumentableTranslator( is PsiAnnotation -> toAnnotation()?.let { AnnotationValue(it) } is PsiArrayInitializerMemberValue -> ArrayValue(initializers.mapNotNull { it.toValue() }) is PsiReferenceExpression -> psiReference?.let { EnumValue(text ?: "", DRI.from(it)) } - is PsiClassObjectAccessExpression -> ClassValue( - text ?: "", - DRI.from(((type as PsiImmediateClassType).parameters.single() as PsiClassReferenceType).resolve()!!) - ) + is PsiClassObjectAccessExpression -> { + val psiClass = ((type as PsiImmediateClassType).parameters.single() as PsiClassReferenceType).resolve() + psiClass?.let { ClassValue(text ?: "", DRI.from(psiClass)) } + } else -> StringValue(text ?: "") } -- cgit