[Android] Catch SecurityException in FileUtils.getUri()

Geoffrey Métais git at videolan.org
Fri Apr 27 14:55:12 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Apr 27 11:17:24 2018 +0200| [6428e8ea2fe0fb7858b225dc90810ba78bb68b15] | committer: Geoffrey Métais

Catch SecurityException in FileUtils.getUri()

> https://code.videolan.org/videolan/vlc-android/commit/6428e8ea2fe0fb7858b225dc90810ba78bb68b15
---

 vlc-android/src/org/videolan/vlc/util/FileUtils.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/util/FileUtils.java b/vlc-android/src/org/videolan/vlc/util/FileUtils.java
index a1d1fde5d..127825862 100644
--- a/vlc-android/src/org/videolan/vlc/util/FileUtils.java
+++ b/vlc-android/src/org/videolan/vlc/util/FileUtils.java
@@ -120,11 +120,10 @@ public class FileUtils {
             final int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
             cursor.moveToFirst();
             return cursor.getString(column_index);
-        } catch (IllegalArgumentException e) {
+        } catch (IllegalArgumentException|SecurityException e) {
                 return "";
         } finally {
-            if (cursor != null && !cursor.isClosed())
-                cursor.close();
+            if (cursor != null && !cursor.isClosed()) cursor.close();
         }
     }
 



More information about the Android mailing list