Handle when data-location.json is not found
Conflicts / Check for conflicts (push) Canceled after 0s
Conflicts / Check for conflicts (push) Canceled after 0s
This commit is contained in:
+7
-3
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user