From 5e32296905bd5ec19106a7dffd9473bb511c2afe Mon Sep 17 00:00:00 2001 From: Major Date: Sat, 7 Mar 2020 07:36:41 +0000 Subject: [PATCH] Fix NPE for FrameNodes that aren't NEW/FULL All of the other types have a value of null for their list of locals/stack elements. Signed-off-by: Major --- asm/src/main/java/dev/openrs2/asm/ClassNodeRemapper.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asm/src/main/java/dev/openrs2/asm/ClassNodeRemapper.kt b/asm/src/main/java/dev/openrs2/asm/ClassNodeRemapper.kt index 99195ef9bb..3ab9701f3b 100644 --- a/asm/src/main/java/dev/openrs2/asm/ClassNodeRemapper.kt +++ b/asm/src/main/java/dev/openrs2/asm/ClassNodeRemapper.kt @@ -63,8 +63,8 @@ private fun Remapper.mapFrameType(type: Any): Any { private fun AbstractInsnNode.remap(remapper: Remapper) { when (this) { is FrameNode -> { - local = local.map(remapper::mapFrameType) - stack = stack.map(remapper::mapFrameType) + local = local?.map(remapper::mapFrameType) + stack = stack?.map(remapper::mapFrameType) } is FieldInsnNode -> { val originalOwner = owner