Skip to content

Commit

Permalink
Update sdk/src/test/kotlin/org/onflow/flow/sdk/TestUtils.kt
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
lealobanov and coderabbitai[bot] authored Jul 19, 2024
1 parent 880952c commit d37c3e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/src/test/kotlin/org/onflow/flow/sdk/TestUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ object TestUtils {
private const val MAINNET_HOSTNAME = "access.mainnet.nodes.onflow.org"
private const val TESTNET_HOSTNAME = "access.devnet.nodes.onflow.org"

fun loadScript(name: String): ByteArray = javaClass.classLoader.getResourceAsStream(name)!!.use { it.readAllBytes() }
fun loadScript(name: String): ByteArray = javaClass.classLoader.getResourceAsStream(name)?.use { it.readAllBytes() } ?: throw IllegalArgumentException("Script not found: $name")
}

0 comments on commit d37c3e2

Please sign in to comment.