Skip to content

Commit

Permalink
Fix mapping of the TogglEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasHromadnik committed Mar 10, 2020
1 parent 7d3694f commit 2a80a68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/Toggl2Redmine/Models/TogglEntry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ extension TogglEntry: Codable {
init(from decoder: Decoder) throws {
let container = try! decoder.container(keyedBy: CodingKeys.self)
id = try! container.decode(Int.self, forKey: .id)
description = try! container.decode(String.self, forKey: .description)
let description = try! container.decodeIfPresent(String.self, forKey: .description)
self.description = description ?? ""
start = try! container.decode(Date.self, forKey: .start)
duration = try! container.decode(Int.self, forKey: .duration)
let tags = try! container.decodeIfPresent([String].self, forKey: .tags)
Expand Down

0 comments on commit 2a80a68

Please sign in to comment.