Fix elvis operator on non-nullable type warning

Signed-off-by: Graham <gpe@openrs2.org>
bzip2
Graham 3 years ago
parent 3368818ca1
commit 2a6ffa87a6
  1. 4
      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<XteaKey>(key) ?: throw IOException("Key must be non-null")
keys += mapper.treeToValue<XteaKey?>(key) ?: throw IOException("Key must be non-null")
}
}
root.isObject -> {
for (entry in root.fields()) {
keys += mapper.treeToValue<XteaKey>(entry.value) ?: throw IOException("Key must be non-null")
keys += mapper.treeToValue<XteaKey?>(entry.value) ?: throw IOException("Key must be non-null")
}
}
else -> throw IOException("Root element must be an array or object")

Loading…
Cancel
Save