Fix potential crash

This commit is contained in:
MM20
2023-01-23 21:14:21 +01:00
parent 6d0abb928e
commit 2ae19260fb
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -52,4 +52,5 @@ dependencies {
implementation(project(":libs:owncloud")) implementation(project(":libs:owncloud"))
implementation(project(":core:i18n")) implementation(project(":core:i18n"))
implementation(project(":core:permissions")) implementation(project(":core:permissions"))
implementation(project(":core:crashreporter"))
} }
@@ -15,6 +15,7 @@ import android.text.format.DateUtils
import android.util.Size import android.util.Size
import androidx.core.content.FileProvider import androidx.core.content.FileProvider
import androidx.exifinterface.media.ExifInterface import androidx.exifinterface.media.ExifInterface
import de.mm20.launcher2.crashreporter.CrashReporter
import de.mm20.launcher2.files.R import de.mm20.launcher2.files.R
import de.mm20.launcher2.icons.* import de.mm20.launcher2.icons.*
import de.mm20.launcher2.ktx.formatToString import de.mm20.launcher2.ktx.formatToString
@@ -291,6 +292,10 @@ data class LocalFile(
} }
retriever.release() retriever.release()
} catch (e: RuntimeException) { } catch (e: RuntimeException) {
CrashReporter.logException(e)
} catch (e: IOException) {
CrashReporter.logException(e)
} finally {
retriever.release() retriever.release()
} }
} }