From 2a6ffa87a632b263652f5ee949b293de064a35c0 Mon Sep 17 00:00:00 2001 From: Graham Date: Fri, 29 Oct 2021 18:16:27 +0100 Subject: [PATCH] Fix elvis operator on non-nullable type warning Signed-off-by: Graham --- .../src/main/kotlin/org/openrs2/archive/key/JsonKeyReader.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archive/src/main/kotlin/org/openrs2/archive/key/JsonKeyReader.kt b/archive/src/main/kotlin/org/openrs2/archive/key/JsonKeyReader.kt index eea14fc8..374b4c7f 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/key/JsonKeyReader.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/key/JsonKeyReader.kt @@ -21,12 +21,12 @@ public class JsonKeyReader @Inject constructor( root.isArray -> { for (entry in root) { val key = entry["key"] ?: entry["keys"] ?: throw IOException("Missing 'key' or 'keys' field") - keys += mapper.treeToValue(key) ?: throw IOException("Key must be non-null") + keys += mapper.treeToValue(key) ?: throw IOException("Key must be non-null") } } root.isObject -> { for (entry in root.fields()) { - keys += mapper.treeToValue(entry.value) ?: throw IOException("Key must be non-null") + keys += mapper.treeToValue(entry.value) ?: throw IOException("Key must be non-null") } } else -> throw IOException("Root element must be an array or object")