stats: Actually initialize the word maps

This commit is contained in:
Hamcha 2016-02-13 23:56:43 +01:00
parent 0a117e7918
commit 1389b5dc40

View file

@ -325,10 +325,14 @@ func processWords(message tg.APIMessage) {
data := b.Get([]byte(word)) data := b.Get([]byte(word))
var count UserCount var count UserCount
if data == nil {
count = make(UserCount)
} else {
err := json.Unmarshal(data, &count) err := json.Unmarshal(data, &count)
if err != nil { if err != nil {
return err return err
} }
}
val, ok := count[message.User.Username] val, ok := count[message.User.Username]
if !ok { if !ok {