Fix NoSuchElementException

This commit is contained in:
Mygod
2019-02-04 13:17:56 +08:00
committed by GitHub
parent df5ef5731d
commit fadf72b28a

View File

@@ -79,7 +79,8 @@ class Routing(val caller: Any, val downstream: String, ownerAddress: InterfaceAd
private fun RootSession.Transaction.ndc(name: String, command: String, revert: String) { private fun RootSession.Transaction.ndc(name: String, command: String, revert: String) {
val result = execQuiet(command, revert) val result = execQuiet(command, revert)
val log = RootSession.checkOutput(command, result, result.out.last() != "200 0 $name operation succeeded") val log = RootSession.checkOutput(command, result,
result.out.lastOrNull() != "200 0 $name operation succeeded")
if (result.out.size > 1) Timber.i(log) if (result.out.size > 1) Timber.i(log)
} }
} }