LogViewerActivity: don't crash if pipe closes
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
bc186fe6ad
commit
017f420d42
@ -346,7 +346,10 @@ class LogViewerActivity : AppCompatActivity() {
|
|||||||
if (mode != "r") return null
|
if (mode != "r") return null
|
||||||
val log = logForUri(uri) ?: return null
|
val log = logForUri(uri) ?: return null
|
||||||
return openPipeHelper(uri, "text/plain", null, log) { output, _, _, _, l ->
|
return openPipeHelper(uri, "text/plain", null, log) { output, _, _, _, l ->
|
||||||
FileOutputStream(output.fileDescriptor).write(l!!)
|
try {
|
||||||
|
FileOutputStream(output.fileDescriptor).write(l!!)
|
||||||
|
} catch (_: Exception) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user