Explorar el Código

Fix crash for invalid timeline queries

Zed hace 7 años
padre
commit
5510330f70
Se han modificado 1 ficheros con 4 adiciones y 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(" | ")