don't embed emus that don't exist
Ted Unangst tedu@tedunangst.com
Sun, 07 Jul 2019 20:07:16 -0400
1 files changed,
4 insertions(+),
0 deletions(-)
jump to
M
fun.go
→
fun.go
@@ -193,6 +193,10 @@ m = oneofakind(m)
var emus []Emu for _, e := range m { fname := e[1 : len(e)-1] + _, err := os.Stat("emus/" + fname + ".png") + if err != nil { + continue + } url := fmt.Sprintf("https://%s/emu/%s.png", serverName, fname) emus = append(emus, Emu{ID: url, Name: e}) }