From 3793a2763a4ef1d3d4d12297b28cdc4776c99dbe Mon Sep 17 00:00:00 2001 From: Feelfree Date: Sat, 10 Nov 2018 23:46:41 +0100 Subject: [PATCH] fix: links crash --- .../wykopmobilny/models/mapper/apiv2/LinkCommentMapper.kt | 3 ++- .../models/pojo/apiv2/models/LinkCommentResponse.kt | 2 +- build.gradle | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/models/mapper/apiv2/LinkCommentMapper.kt b/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/models/mapper/apiv2/LinkCommentMapper.kt index 34758eb0a..8729cf6c4 100755 --- a/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/models/mapper/apiv2/LinkCommentMapper.kt +++ b/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/models/mapper/apiv2/LinkCommentMapper.kt @@ -2,6 +2,7 @@ package io.github.feelfreelinux.wykopmobilny.models.mapper.apiv2 import io.github.feelfreelinux.wykopmobilny.api.filters.OWMContentFilter import io.github.feelfreelinux.wykopmobilny.models.dataclass.LinkComment +import io.github.feelfreelinux.wykopmobilny.models.pojo.apiv2.models.AuthorResponse import io.github.feelfreelinux.wykopmobilny.models.pojo.apiv2.models.LinkCommentResponse import io.github.feelfreelinux.wykopmobilny.utils.toPrettyDate @@ -10,7 +11,7 @@ class LinkCommentMapper { fun map(value: LinkCommentResponse, owmContentFilter: OWMContentFilter) = owmContentFilter.filterLinkComment( LinkComment( - value.id, AuthorMapper.map(value.author), value.date, + value.id, AuthorMapper.map(value.author ?: AuthorResponse("", 9999, "", "")), value.date, value.body, value.blocked, value.favorite, value.voteCount, value.voteCountPlus, diff --git a/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/models/pojo/apiv2/models/LinkCommentResponse.kt b/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/models/pojo/apiv2/models/LinkCommentResponse.kt index 781a370f3..42ebb7a18 100755 --- a/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/models/pojo/apiv2/models/LinkCommentResponse.kt +++ b/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/models/pojo/apiv2/models/LinkCommentResponse.kt @@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty @JsonIgnoreProperties(ignoreUnknown = true) data class LinkCommentResponse( @JsonProperty("id") val id: Int, - @JsonProperty("author") val author: AuthorResponse, + @JsonProperty("author") val author: AuthorResponse?, @JsonProperty("date") val date: String, @JsonProperty("body") val body: String?, @JsonProperty("blocked") val blocked: Boolean, diff --git a/build.gradle b/build.gradle index 1941a3636..36a417c84 100755 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ allprojects { versionMajor = 0 versionMinor = 9 versionPatch = 7 - versionBuild = 3 + versionBuild = 4 } }