From 4a3d668b52e90bee6de5dfb45ed087a63165fe55 Mon Sep 17 00:00:00 2001
From: Jason Volk <jason@zemos.net>
Date: Tue, 14 Apr 2020 21:42:39 -0700
Subject: [PATCH] prev_batch and limited fields are not required; defaults
 added.

---
 lib/structs/responses/sync.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/structs/responses/sync.cpp b/lib/structs/responses/sync.cpp
index 71c94ade7..accd24ecf 100644
--- a/lib/structs/responses/sync.cpp
+++ b/lib/structs/responses/sync.cpp
@@ -25,8 +25,8 @@ from_json(const json &obj, State &state)
 void
 from_json(const json &obj, Timeline &timeline)
 {
-        timeline.prev_batch = obj.at("prev_batch");
-        timeline.limited    = obj.at("limited");
+        timeline.prev_batch = obj.value("prev_batch", std::string{});
+        timeline.limited    = obj.value("limited", false);
 
         utils::parse_timeline_events(obj.at("events"), timeline.events);
 }
-- 
GitLab