Handle when data-location.json is not found
Conflicts / Check for conflicts (push) Canceled after 0s

This commit is contained in:
Emma
2026-04-09 13:49:12 -04:00
parent d9073cb301
commit 7f092a89cd
@@ -154,9 +154,13 @@ class FreeTubeJavaScriptInterface(
return Promise(coroutineScope) { resolve, reject ->
val file = context.resolveAmbiguousUri(uri)
if (file != null) {
resolve(context.contentResolver
.readBytes(file.uri)
?.toString(Charset.forName("utf-8")) ?: "")
try {
resolve(context.contentResolver
.readBytes(file.uri)
?.toString(Charset.forName("utf-8")))
} catch (ex: Throwable) {
reject(ex.stackTraceToString())
}
} else {
reject("File not found from given uri")
}