Fix potential crash

This commit is contained in:
MM20 2023-01-23 21:14:21 +01:00
parent 6d0abb928e
commit 2ae19260fb
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389
2 changed files with 6 additions and 0 deletions

View File

@ -52,4 +52,5 @@ dependencies {
implementation(project(":libs:owncloud"))
implementation(project(":core:i18n"))
implementation(project(":core:permissions"))
implementation(project(":core:crashreporter"))
}

View File

@ -15,6 +15,7 @@ import android.text.format.DateUtils
import android.util.Size
import androidx.core.content.FileProvider
import androidx.exifinterface.media.ExifInterface
import de.mm20.launcher2.crashreporter.CrashReporter
import de.mm20.launcher2.files.R
import de.mm20.launcher2.icons.*
import de.mm20.launcher2.ktx.formatToString
@ -291,6 +292,10 @@ data class LocalFile(
}
retriever.release()
} catch (e: RuntimeException) {
CrashReporter.logException(e)
} catch (e: IOException) {
CrashReporter.logException(e)
} finally {
retriever.release()
}
}