aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2016-11-15 18:17:14 (UTC)
committerjan <jan@ruken.pw>2016-11-15 18:17:14 (UTC)
commitf4a485fe8227b98c417f1ecb52251fb2a9638911 (patch)
treee544c09909570a607bf6c396dc7580c8bb17cebf
parent16e0a9a5ed4f61aec2fbda0fff921e92de732214 (diff)
Scan error fixen. Danke Lukas
-rw-r--r--modules/grils/grils.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/grils/grils.go b/modules/grils/grils.go
index b0aa486..a7cc65e 100644
--- a/modules/grils/grils.go
+++ b/modules/grils/grils.go
@@ -109,11 +109,21 @@ func (m *GrilsModule) ProvideDashboardData(user *charakterin.User) []grilist.Das
109 109
110 for rows.Next() { 110 for rows.Next() {
111 var g models.Gril 111 var g models.Gril
112 if err := rows.Scan(&g.ID, &g.RomajiName, &g.KanjiName); err != nil { 112
113 var romaji *string
114 var kanji *string
115 if err := rows.Scan(&g.ID, &romaji, &kanji); err != nil {
113 log.Println(err) 116 log.Println(err)
114 continue 117 continue
115 } 118 }
116 119
120 if romaji != nil {
121 g.RomajiName = *romaji
122 }
123 if kanji != nil {
124 g.KanjiName = *kanji
125 }
126
117 cat.Cards = append(cat.Cards, frontend.Card{ 127 cat.Cards = append(cat.Cards, frontend.Card{
118 Title: g.RomajiName, 128 Title: g.RomajiName,
119 Description: g.KanjiName, 129 Description: g.KanjiName,