Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c1680a5 authored by tibbi's avatar tibbi
Browse files

fix a crash at getting OTG items

parent bdfd1e3a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -291,6 +291,11 @@ fun Context.getOTGItems(path: String, countHiddenItems: Boolean, getProperFileSi
    val items = ArrayList<FileDirItem>()
    val OTGTreeUri = baseConfig.OTGTreeUri
    var rootUri = DocumentFile.fromTreeUri(applicationContext, Uri.parse(OTGTreeUri))
    if (rootUri == null) {
        callback(items)
        return
    }

    val parts = path.split("/").dropLastWhile { it.isEmpty() }
    for (part in parts) {
        if (path == OTG_PATH) {