From b391191b75dc909abadaa639eb66010100c2917f Mon Sep 17 00:00:00 2001 From: Major Date: Sat, 7 Mar 2020 07:23:22 +0000 Subject: [PATCH] Add error messages to AsmClassMetadata Signed-off-by: Major --- .../main/java/dev/openrs2/asm/classpath/AsmClassMetadata.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asm/src/main/java/dev/openrs2/asm/classpath/AsmClassMetadata.kt b/asm/src/main/java/dev/openrs2/asm/classpath/AsmClassMetadata.kt index 9c1af044..3805db33 100644 --- a/asm/src/main/java/dev/openrs2/asm/classpath/AsmClassMetadata.kt +++ b/asm/src/main/java/dev/openrs2/asm/classpath/AsmClassMetadata.kt @@ -16,10 +16,10 @@ class AsmClassMetadata( get() = clazz.access and Opcodes.ACC_INTERFACE != 0 override val superClass - get() = if (clazz.superName != null) classPath[clazz.superName]!! else null + get() = clazz.superName?.let { classPath[it] ?: error("Failed to find $it on provided classpath.") } override val superInterfaces - get() = clazz.interfaces.map { classPath[it]!! }.toList() + get() = clazz.interfaces.map { classPath[it] ?: error("Failed to find $it on provided classpath.") }.toList() override val fields get() = clazz.fields.map { MemberDesc(it) }.toList()