[Android] Fix media thumbnail deletion crash
Nicolas Pomepuy
git at videolan.org
Mon Sep 4 09:59:36 UTC 2023
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Sep 1 07:39:05 2023 +0200| [8d639cbe2acc5ceff35fad2ecdcd82156189e1bc] | committer: Duncan McNamara
Fix media thumbnail deletion crash
Fixes #2989
> https://code.videolan.org/videolan/vlc-android/commit/8d639cbe2acc5ceff35fad2ecdcd82156189e1bc
---
.../vlc-android/src/org/videolan/vlc/viewmodels/CallBackDelegate.kt | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/viewmodels/CallBackDelegate.kt b/application/vlc-android/src/org/videolan/vlc/viewmodels/CallBackDelegate.kt
index ee6b2efb6e..a272d3e21f 100644
--- a/application/vlc-android/src/org/videolan/vlc/viewmodels/CallBackDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/viewmodels/CallBackDelegate.kt
@@ -129,8 +129,7 @@ class CallBackDelegate : ICallBackHandler,
AppContextProvider.appContext.getExternalFilesDir(null)?.let {
val file = File(it.absolutePath + Medialibrary.MEDIALIB_FOLDER_NAME + "/$mediaId.jpg")
if (file.exists()) {
- val media = medialibrary.getMedia(mediaId)
- media.removeThumbnail()
+ medialibrary.getMedia(mediaId)?.removeThumbnail()
}
FileUtils.deleteFile(file)
}
More information about the Android
mailing list