sonar fixes
This commit is contained in:
+3
-1
@@ -106,7 +106,9 @@ class MediaCompressor {
|
||||
} catch (e: Exception) {
|
||||
if (e is CancellationException) throw e
|
||||
Log.d("MediaCompressor", "Image compression failed: ${e.message}")
|
||||
tempFile?.delete()
|
||||
if (tempFile?.delete() == false) {
|
||||
Log.w("MediaCompressor", "Failed to delete temp file: ${tempFile.absolutePath}")
|
||||
}
|
||||
MediaCompressorResult(uri, contentType, null)
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -232,7 +232,9 @@ object VideoCompressionHelper {
|
||||
|
||||
// Sanity check: compression not smaller than original
|
||||
if (originalSize in 1..size) {
|
||||
File(path).delete()
|
||||
if (!File(path).delete()) {
|
||||
Log.w("VideoCompressionHelper", "Failed to delete compressed file: $path")
|
||||
}
|
||||
applicationContext.notifyUser(
|
||||
"Compressed file larger than original. Using original.",
|
||||
Log.WARN,
|
||||
|
||||
Reference in New Issue
Block a user