Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit 5d343cf

Browse files
Gracefully deserialize the media_details.sizes property as array when it's empty
1 parent 3b731c3 commit 5d343cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpapi/media/MediaWPRestResponse.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import com.google.gson.annotations.SerializedName
66
import org.apache.commons.text.StringEscapeUtils
77
import org.wordpress.android.fluxc.model.MediaModel
88
import org.wordpress.android.fluxc.model.MediaModel.MediaUploadState
9+
import org.wordpress.android.fluxc.network.rest.JsonObjectOrEmptyArray
910
import org.wordpress.android.fluxc.network.rest.wpcom.media.MediaWPComRestResponse
1011
import org.wordpress.android.util.DateTimeUtils
1112
import java.text.SimpleDateFormat
@@ -45,7 +46,7 @@ data class MediaWPRESTResponse(
4546
val medium: ImageSize?,
4647
val thumbnail: ImageSize?,
4748
val full: ImageSize?
48-
)
49+
): JsonObjectOrEmptyArray()
4950

5051
data class ImageSize(
5152
val path: String?,

0 commit comments

Comments
 (0)