deal with fact split gives us empty strings
This commit is contained in:
parent
194c9a1223
commit
f0deac732d
12
honk.go
12
honk.go
|
@ -847,7 +847,9 @@ func getxonk(userid int64, xid string) *Honk {
|
|||
h.Date, _ = time.Parse(dbtimeformat, dt)
|
||||
h.Audience = strings.Split(aud, " ")
|
||||
h.Public = !keepitquiet(h.Audience)
|
||||
h.Onts = strings.Split(onts, " ")
|
||||
if len(onts) > 0 {
|
||||
h.Onts = strings.Split(onts, " ")
|
||||
}
|
||||
return h
|
||||
}
|
||||
|
||||
|
@ -866,7 +868,9 @@ func getbonk(userid int64, xid string) *Honk {
|
|||
h.Date, _ = time.Parse(dbtimeformat, dt)
|
||||
h.Audience = strings.Split(aud, " ")
|
||||
h.Public = !keepitquiet(h.Audience)
|
||||
h.Onts = strings.Split(onts, " ")
|
||||
if len(onts) > 0 {
|
||||
h.Onts = strings.Split(onts, " ")
|
||||
}
|
||||
return h
|
||||
}
|
||||
|
||||
|
@ -940,7 +944,9 @@ func getsomehonks(rows *sql.Rows, err error) []*Honk {
|
|||
h.Date, _ = time.Parse(dbtimeformat, dt)
|
||||
h.Audience = strings.Split(aud, " ")
|
||||
h.Public = !keepitquiet(h.Audience)
|
||||
h.Onts = strings.Split(onts, " ")
|
||||
if len(onts) > 0 {
|
||||
h.Onts = strings.Split(onts, " ")
|
||||
}
|
||||
honks = append(honks, &h)
|
||||
}
|
||||
rows.Close()
|
||||
|
|
Loading…
Reference in New Issue