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) {