Skip to content

Commit

Permalink
fix: links crash
Browse files Browse the repository at this point in the history
  • Loading branch information
feelfreelinux committed Nov 10, 2018
1 parent 8e63a8b commit 3793a27
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ allprojects {
versionMajor = 0
versionMinor = 9
versionPatch = 7
versionBuild = 3
versionBuild = 4
}
}

Expand Down

0 comments on commit 3793a27

Please sign in to comment.