Skip to content

Commit

Permalink
Fix that horrible panicking death that happens when the queue is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy-d committed Sep 22, 2010
1 parent f20b146 commit 8c84411
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/now/now.go
Expand Up @@ -36,7 +36,10 @@ func getNext() string {
var out interface{}
json.Unmarshal(buf.Bytes(), &out)

return out.(string)
if out != nil {
return out.(string)
}
return ""
}

func main() {
Expand All @@ -48,5 +51,7 @@ func main() {

thing := getNext()

fmt.Println(thing)
if thing != "" {
fmt.Println(thing)
}
}

0 comments on commit 8c84411

Please sign in to comment.