diff --git a/sekret-compiler-plugin/src/main/kotlin/dev/datlag/sekret/generator/DeobfuscatorGenerator.kt b/sekret-compiler-plugin/src/main/kotlin/dev/datlag/sekret/generator/DeobfuscatorGenerator.kt index d9c7943..06c4db6 100644 --- a/sekret-compiler-plugin/src/main/kotlin/dev/datlag/sekret/generator/DeobfuscatorGenerator.kt +++ b/sekret-compiler-plugin/src/main/kotlin/dev/datlag/sekret/generator/DeobfuscatorGenerator.kt @@ -71,7 +71,7 @@ object DeobfuscatorGenerator { logger.warn("Class found: ${irClass != null}") - irClass!!.fields.firstNotNullOf { + irClass?.fields?.firstNotNullOf { logger.warn(it.name.asString()) } @@ -80,11 +80,11 @@ object DeobfuscatorGenerator { it.name == Name.identifier("values") } - irClass!!.addFunction { + irClass?.addFunction { name = Name.identifier("get") isOperator = true returnType = pluginContext.irBuiltIns.stringType - }.also { function -> + }?.also { function -> val id = function.addValueParameter { name = Name.identifier("id") type = pluginContext.irBuiltIns.longType