Skip to content
Snippets Groups Projects
Commit cb3faedd authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Fix PathOperation crash

parent 568788e6
No related branches found
No related tags found
1 merge request!721Add a flag and update kt version to get more info on the JobCancellationException crash
......@@ -43,7 +43,7 @@ class PathOperationDelegate : IPathOperationDelegate {
*/
override fun appendPathToUri(path: String, uri: Uri.Builder) {
var newPath = path
for (i in 0..storages.size()) if (storages.valueAt(i) == newPath) newPath = storages.keyAt(i)
for (i in 0 until storages.size()) if (storages.valueAt(i) == newPath) newPath = storages.keyAt(i)
newPath.split('/').forEach {
uri.appendPath(it)
}
......@@ -57,7 +57,7 @@ class PathOperationDelegate : IPathOperationDelegate {
*/
override fun replaceStoragePath(path: String): String {
try {
if (storages.size() > 0) for (i in 0..storages.size()) if (path.startsWith(storages.keyAt(i))) return path.replace(storages.keyAt(i), storages.valueAt(i))
if (storages.size() > 0) for (i in 0 until storages.size()) if (path.startsWith(storages.keyAt(i))) return path.replace(storages.keyAt(i), storages.valueAt(i))
} catch (e: IllegalStateException) {
}
return path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment