From 806bf8a73530d6c9bd775c60ff5e19ab0e05c9f0 Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Fri, 21 Jan 2022 09:58:22 +0100 Subject: [PATCH] IR [minor]: do not assume that ktfile is always accessible --- .../kotlin/backend/jvm/lower/TypeOperatorLowering.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt b/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt index 51106210d70..0cdea2ce86c 100644 --- a/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt +++ b/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt @@ -772,8 +772,8 @@ private class TypeOperatorLowering(private val backendContext: JvmBackendContext return startOffset to endOffset } - private fun sourceViewFor(declaration: IrDeclaration): CharSequence = - declaration.fileParent.getKtFile()!!.viewProvider.contents + private fun sourceViewFor(declaration: IrDeclaration): CharSequence? = + declaration.fileParent.getKtFile()?.viewProvider?.contents private val throwTypeCastException: IrSimpleFunctionSymbol = backendContext.ir.symbols.throwTypeCastException