Skip to content

Commit 8f816f6

Browse files
committed
fix: npe on error without cause
1 parent 30c045c commit 8f816f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/spp/cli/PlatformCLI.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ object PlatformCLI : CliktCommand(name = "spp-cli", allowMultipleSubcommands = t
165165
fun echoError(e: Exception) {
166166
when (e) {
167167
is ApolloException -> {
168-
echo(e.cause!!.message, err = true)
168+
echo(e.cause?.message ?: e.message, err = true)
169169
if (verbose) {
170-
echo(e.cause!!.stackTraceToString(), err = true)
170+
echo(e.cause?.stackTraceToString() ?: e.stackTraceToString(), err = true)
171171
}
172172
}
173173

0 commit comments

Comments
 (0)