oboeru

a collection of simple, scriptable flashcard programs
git clone anongit@rnpnr.xyz:oboeru.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 6d260d78485cb4cb4ebd9ae536656dc68aa40e86
Parent: e357fbf2eb1bff066544ee7fbee753739bbd28e3
Author: Randy Palamar
Date:   Sat, 21 Aug 2021 13:29:26 -0600

oboerudata: if makemap() returns nil exit

Diffstat:
Moboerudata.go | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/oboerudata.go b/oboerudata.go @@ -54,8 +54,12 @@ func wait_and_print(fifo string) { m[deck] = makemap(split[0]) } - str, _ := m[deck][key] + if m[deck] == nil { + fmt.Fprintln(os.Stderr, "Data for deck doesn't exist:", deck) + os.Exit(1) + } + str, _ := m[deck][key] fmt.Fprintln(os.Stdout, str) f.Close()