mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
null value fixing
This commit is contained in:
parent
6b7d484768
commit
6ed13c7afa
1 changed files with 7 additions and 4 deletions
|
|
@ -53,14 +53,17 @@ class CustomSelectorUtils {
|
||||||
): String =
|
): String =
|
||||||
withContext(defaultDispatcher) {
|
withContext(defaultDispatcher) {
|
||||||
val uploadableFile = PickedFiles.pickedExistingPicture(context, image.uri)
|
val uploadableFile = PickedFiles.pickedExistingPicture(context, image.uri)
|
||||||
val exifInterface: ExifInterface? =
|
val exifInterface: ExifInterface? = uploadableFile.file?.let { file ->
|
||||||
try {
|
try {
|
||||||
ExifInterface(uploadableFile.file!!)
|
ExifInterface(file) // Only create ExifInterface if file is not null
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
Timber.e(e)
|
Timber.e(e, "Error reading EXIF data")
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
fileProcessor.redactExifTags(exifInterface, fileProcessor.getExifTagsToRedact())
|
}
|
||||||
|
// Redact EXIF tags if exifInterface is not null
|
||||||
|
exifInterface?.let {
|
||||||
|
fileProcessor.redactExifTags(exifInterface, fileProcessor.getExifTagsToRedact()) }
|
||||||
val sha1 =
|
val sha1 =
|
||||||
fileUtilsWrapper.getSHA1(
|
fileUtilsWrapper.getSHA1(
|
||||||
fileUtilsWrapper.getFileInputStream(uploadableFile.getFilePath()),
|
fileUtilsWrapper.getFileInputStream(uploadableFile.getFilePath()),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue