diff options
| author | JosJuice <josjuice@gmail.com> | 2020-11-04 20:59:39 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2020-11-06 17:40:03 +0100 |
| commit | 70df5446d3f0bc203363ad74e737fd772e8e9c2c (patch) | |
| tree | e840595646f5fd6ae8293def17ee60973cf37ea2 /Source/Android/app/src/main/java | |
| parent | 6a4ac74ec407a20b0347c4c764ca528e8d692cc1 (diff) | |
Android: Make the handling of SAF open modes more robust
Diffstat (limited to 'Source/Android/app/src/main/java')
| -rw-r--r-- | Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ContentHandler.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ContentHandler.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ContentHandler.java index 83b9c585c9..dc4472a212 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ContentHandler.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ContentHandler.java @@ -17,7 +17,9 @@ public class ContentHandler return DolphinApplication.getAppContext().getContentResolver() .openFileDescriptor(Uri.parse(uri), mode).detachFd(); } - catch (FileNotFoundException | NullPointerException e) + // Some content providers throw IllegalArgumentException for invalid modes, + // despite the documentation saying that invalid modes result in a FileNotFoundException + catch (FileNotFoundException | IllegalArgumentException | NullPointerException e) { return -1; } |
