Skip to content

Commit

Permalink
handle possible npe (#2162)
Browse files Browse the repository at this point in the history
return empty map if timeout
  • Loading branch information
lucaswiechmann authored Dec 3, 2024
1 parent 5f971ce commit 367dc6e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions maestro-ios-driver/src/main/kotlin/util/XCRunnerCLIUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,11 @@ object XCRunnerCLIUtils {
"list"
).start()

val processOutput = process.inputStream
.bufferedReader()
.readLines()

process.waitFor(3000, TimeUnit.MILLISECONDS)
val processOutput = process.inputStream.bufferedReader().readLines()

if (!process.waitFor(3000, TimeUnit.MILLISECONDS)) {
return emptyMap()
}
return processOutput
.asSequence()
.drop(1)
Expand Down

0 comments on commit 367dc6e

Please sign in to comment.