Skip to content

Commit

Permalink
[Refactor] Check for invalid URI formats
Browse files Browse the repository at this point in the history
Signed-off-by: Muntashir Al-Islam <[email protected]>
  • Loading branch information
MuntashirAkon committed Mar 25, 2024
1 parent 8166ba7 commit 42677de
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ public static CharSequence toLocalisedString(@NonNull Context context, @NonNull
String file;
if (isTree) {
file = paths.size() == 4 ? paths.get(3) : null;
} else file = paths.get(1);
} else if (paths.size() > 2) {
file = paths.get(1);
} else {
throw new UnsupportedOperationException("Unsupported URI: " + uri);
}
SpannableStringBuilder sb = new SpannableStringBuilder();
if (basePath != null) {
String realPath = getRealPath(authority, basePath);
Expand Down

0 comments on commit 42677de

Please sign in to comment.