From 202459d84d80458f822943390df4cebdfe7b99ea Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 30 Oct 2024 18:46:29 +0000 Subject: [PATCH] feat(api): manual updates --- .../src/main/kotlin/com/openlayer/api/core/Utils.kt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/Utils.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/Utils.kt index 8f46e25..4fe94f1 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/Utils.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/core/Utils.kt @@ -9,13 +9,8 @@ import com.openlayer.api.errors.OpenlayerInvalidDataException import java.util.Collections @JvmSynthetic -internal fun T?.getOrThrow(name: String): T { - if (this == null) { - throw OpenlayerInvalidDataException("'${name}' is not present") - } - - return this -} +internal fun T?.getOrThrow(name: String): T = + this ?: throw OpenlayerInvalidDataException("`${name}` is not present") @JvmSynthetic internal fun List.toUnmodifiable(): List {