From 865a378804db3a1816f9aac9d9473d69fc79a4d4 Mon Sep 17 00:00:00 2001 From: yory8 <> Date: Wed, 17 Jul 2019 10:03:41 +0200 Subject: [PATCH] fix(selector): exit on empty history --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index 5dc2c38..589bdd9 100644 --- a/main.go +++ b/main.go @@ -44,6 +44,9 @@ func main() { persist := !*noPersist listen(history, histfile, persist, *max) } else if *asSelector { + if len(history) == 0 { + log.Fatal("No history available") + } if err := selector(history, *max, *tool); err != nil { log.Fatal(err) }