We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 138e75b commit 394e18dCopy full SHA for 394e18d
openlayer-java-core/src/main/kotlin/com/openlayer/api/core/Utils.kt
@@ -9,13 +9,8 @@ import com.openlayer.api.errors.OpenlayerInvalidDataException
9
import java.util.Collections
10
11
@JvmSynthetic
12
-internal fun <T : Any> T?.getOrThrow(name: String): T {
13
- if (this == null) {
14
- throw OpenlayerInvalidDataException("'${name}' is not present")
15
- }
16
-
17
- return this
18
-}
+internal fun <T : Any> T?.getOrThrow(name: String): T =
+ this ?: throw OpenlayerInvalidDataException("`${name}` is not present")
19
20
21
internal fun <T> List<T>.toUnmodifiable(): List<T> {
0 commit comments