Fix the panic.
This commit is contained in:
parent
1bd3d7d104
commit
de03f5ae63
@ -486,18 +486,19 @@ func routeTopicID(w http.ResponseWriter, r *http.Request, user common.User, urlB
|
|||||||
topic.Avatar = strings.Replace(common.Config.Noavatar, "{id}", strconv.Itoa(topic.CreatedBy), 1)
|
topic.Avatar = strings.Replace(common.Config.Noavatar, "{id}", strconv.Itoa(topic.CreatedBy), 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
var poll *common.Poll
|
var poll common.Poll
|
||||||
if topic.Poll != 0 {
|
if topic.Poll != 0 {
|
||||||
poll, err = common.Polls.Get(topic.Poll)
|
pPoll, err := common.Polls.Get(topic.Poll)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print("Couldn't find the attached poll for topic " + strconv.Itoa(topic.ID))
|
log.Print("Couldn't find the attached poll for topic " + strconv.Itoa(topic.ID))
|
||||||
return common.InternalError(err, w, r)
|
return common.InternalError(err, w, r)
|
||||||
}
|
}
|
||||||
|
poll = pPoll.Copy()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the offset
|
// Calculate the offset
|
||||||
offset, page, lastPage := common.PageOffset(topic.PostCount, page, common.Config.ItemsPerPage)
|
offset, page, lastPage := common.PageOffset(topic.PostCount, page, common.Config.ItemsPerPage)
|
||||||
tpage := common.TopicPage{topic.Title, user, headerVars, replyList, topic, poll.Copy(), page, lastPage}
|
tpage := common.TopicPage{topic.Title, user, headerVars, replyList, topic, poll, page, lastPage}
|
||||||
|
|
||||||
// Get the replies..
|
// Get the replies..
|
||||||
rows, err := stmts.getTopicRepliesOffset.Query(topic.ID, offset, common.Config.ItemsPerPage)
|
rows, err := stmts.getTopicRepliesOffset.Query(topic.ID, offset, common.Config.ItemsPerPage)
|
||||||
|
@ -535,6 +535,10 @@ input[type=checkbox]:checked + label .sel {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.poll_option_text {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
.formbutton {
|
.formbutton {
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
|
Loading…
Reference in New Issue
Block a user