From 33301d62827ee52ea7c66b539209322bba13fed2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 1 Dec 2018 11:41:02 +0100 Subject: [PATCH] make sure the file is a video, before getting its duration --- .../com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index c9f644991..24d571dfa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -232,7 +232,7 @@ class MediaFetcher(val context: Context) { } else { val lastModified = file.lastModified() var dateTaken = lastModified - val videoDuration = if (getVideoDurations) path.getVideoDuration() else 0 + val videoDuration = if (getVideoDurations && isVideo) path.getVideoDuration() else 0 if (getProperDateTaken) { dateTaken = dateTakens.remove(filename) ?: lastModified