Explorar o código

Fix crash for invalid timeline queries

Zed %!s(int64=7) %!d(string=hai) anos
pai
achega
5510330f70
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/views/search.nim

+ 4 - 1
src/views/search.nim

@@ -13,7 +13,10 @@ proc renderSearch*(): VNode =
         button(`type`="submit"): icon "search"
 
 proc renderTweetSearch*(timeline: Timeline; prefs: Prefs; path: string): VNode =
-  let users = get(timeline.query).fromUser
+  let users =
+    if timeline.query.isSome: get(timeline.query).fromUser
+    else: @[]
+
   buildHtml(tdiv(class="timeline-container")):
     tdiv(class="timeline-header"):
       text users.join(" | ")