Avoid logging warning why attempting to delete unexisting file.
This commit is contained in:
parent
f2900de7af
commit
4fa1327925
1 changed files with 1 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ import java.util.Locale
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
|
|
||||||
fun File.safeDelete() {
|
fun File.safeDelete() {
|
||||||
|
if (exists().not()) return
|
||||||
tryOrNull(
|
tryOrNull(
|
||||||
onError = {
|
onError = {
|
||||||
Timber.e(it, "Error, unable to delete file $path")
|
Timber.e(it, "Error, unable to delete file $path")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue