From 72d79ed82299448ca8462e492d1adb6d53479455 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sun, 21 Jun 2020 06:09:34 +0800 Subject: [PATCH] Fix error --- mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt b/mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt index bac3c38d..e2172e82 100644 --- a/mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt +++ b/mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt @@ -92,6 +92,7 @@ class RootServer @JvmOverloads constructor(private val warnLogger: (String) -> U * It is advised to read this after initializing the instance. */ fun readUnexpectedStderr(): String? { + if (!this::process.isInitialized) return null var available = process.errorStream.available() return if (available <= 0) null else String(ByteArrayOutputStream().apply { while (available > 0) {