[Android] Prevent crash when media name cannot be retrieved

Geoffrey Métais git at videolan.org
Tue Nov 20 17:36:01 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Nov 20 10:26:34 2018 +0100| [9fd1e0a3390811de652ffb406f13e42ca5c2c92a] | committer: Geoffrey Métais

Prevent crash when media name cannot be retrieved

> https://code.videolan.org/videolan/vlc-android/commit/9fd1e0a3390811de652ffb406f13e42ca5c2c92a
---

 vlc-android/src/org/videolan/vlc/media/MediaUtils.kt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/media/MediaUtils.kt b/vlc-android/src/org/videolan/vlc/media/MediaUtils.kt
index 658cbf087..3a7284dfd 100644
--- a/vlc-android/src/org/videolan/vlc/media/MediaUtils.kt
+++ b/vlc-android/src/org/videolan/vlc/media/MediaUtils.kt
@@ -372,7 +372,9 @@ object MediaUtils : CoroutineScope {
                 if (!it.isNull(nameIndex)) mw.title = it.getString(nameIndex)
             }
         }
-    } catch (ignored: UnsupportedOperationException) {}
+    } catch (ignored: UnsupportedOperationException) {
+    } catch (ignored: IllegalArgumentException) {
+    } catch (ignored: SecurityException) {}
 
     fun deletePlaylist(playlist: Playlist) = launch(Dispatchers.IO) { playlist.delete() }
 }



More information about the Android mailing list