Skip to content

Commit 394e18d

Browse files
feat(api): manual updates (#42)
1 parent 138e75b commit 394e18d

File tree

1 file changed

+2
-7
lines changed
  • openlayer-java-core/src/main/kotlin/com/openlayer/api/core

1 file changed

+2
-7
lines changed

openlayer-java-core/src/main/kotlin/com/openlayer/api/core/Utils.kt

+2-7
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@ import com.openlayer.api.errors.OpenlayerInvalidDataException
99
import java.util.Collections
1010

1111
@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-
}
12+
internal fun <T : Any> T?.getOrThrow(name: String): T =
13+
this ?: throw OpenlayerInvalidDataException("`${name}` is not present")
1914

2015
@JvmSynthetic
2116
internal fun <T> List<T>.toUnmodifiable(): List<T> {

0 commit comments

Comments
 (0)