summaryrefslogtreecommitdiffhomepage
path: root/ui
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-03-30 03:25:47 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2020-03-30 03:25:47 -0600
commit017f420d42df3d5b4c240143b1a5b0ab18cc5113 (patch)
treeec64911e2f9f1dcc63fbd8e3237016376c9622d7 /ui
parentbc186fe6adbc6fb2138c2501a91c6d7c6d05fcd5 (diff)
LogViewerActivity: don't crash if pipe closes
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt b/ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt
index d95913ed..87fdc236 100644
--- a/ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt
+++ b/ui/src/main/java/com/wireguard/android/activity/LogViewerActivity.kt
@@ -346,7 +346,10 @@ class LogViewerActivity : AppCompatActivity() {
if (mode != "r") return null
val log = logForUri(uri) ?: return null
return openPipeHelper(uri, "text/plain", null, log) { output, _, _, _, l ->
- FileOutputStream(output.fileDescriptor).write(l!!)
+ try {
+ FileOutputStream(output.fileDescriptor).write(l!!)
+ } catch (_: Exception) {
+ }
}
}
}