diff --git a/libsession/src/main/java/org/session/libsession/messaging/opengroups/OpenGroupAPI.kt b/libsession/src/main/java/org/session/libsession/messaging/opengroups/OpenGroupAPI.kt index f98703cc2a..30c5b339d8 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/opengroups/OpenGroupAPI.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/opengroups/OpenGroupAPI.kt @@ -113,7 +113,7 @@ object OpenGroupAPI: DotNetAPI() { val id = attachmentAsJSON["id"] as? Long ?: (attachmentAsJSON["id"] as? Int)?.toLong() ?: (attachmentAsJSON["id"] as String).toLong() val contentType = attachmentAsJSON["contentType"] as String val size = attachmentAsJSON["size"] as? Int ?: (attachmentAsJSON["size"] as? Long)?.toInt() ?: (attachmentAsJSON["size"] as String).toInt() - val fileName = attachmentAsJSON["fileName"] as String + val fileName = attachmentAsJSON["fileName"] as? String val flags = 0 val url = attachmentAsJSON["url"] as String val caption = attachmentAsJSON["caption"] as? String diff --git a/libsession/src/main/java/org/session/libsession/messaging/opengroups/OpenGroupMessage.kt b/libsession/src/main/java/org/session/libsession/messaging/opengroups/OpenGroupMessage.kt index 221c47916a..07c9c9836b 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/opengroups/OpenGroupMessage.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/opengroups/OpenGroupMessage.kt @@ -74,7 +74,7 @@ data class OpenGroupMessage( attachment.id, attachment.contentType!!, attachment.size.orNull(), - attachment.fileName.orNull(), + attachment.fileName.orNull() ?: "", 0, attachment.width, attachment.height,