From bd2fcb9d2583eb186171d70f4140b64350f34d67 Mon Sep 17 00:00:00 2001 From: Callum Stott Date: Mon, 13 May 2024 15:06:17 +0100 Subject: [PATCH] Fix nullable value --- .../collect/android/utilities/ImageCompressionController.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/collect_app/src/main/java/org/odk/collect/android/utilities/ImageCompressionController.kt b/collect_app/src/main/java/org/odk/collect/android/utilities/ImageCompressionController.kt index a4953c82e68..c7a19f9944b 100644 --- a/collect_app/src/main/java/org/odk/collect/android/utilities/ImageCompressionController.kt +++ b/collect_app/src/main/java/org/odk/collect/android/utilities/ImageCompressionController.kt @@ -27,12 +27,13 @@ class ImageCompressionController(private val imageCompressor: ImageCompressor) { for (bindAttribute in questionWidget.formEntryPrompt.bindAttributes) { if ("max-pixels" == bindAttribute.name && ApplicationConstants.Namespaces.XML_OPENROSA_NAMESPACE == bindAttribute.namespace) { try { - return bindAttribute.attributeValue.toInt() + return bindAttribute.attributeValue?.toInt() } catch (e: NumberFormatException) { Timber.i(e) } } } + return null }