Fix the panic.

This commit is contained in:
Azareal 2018-01-26 07:04:01 +00:00
parent 1bd3d7d104
commit de03f5ae63
2 changed files with 8 additions and 3 deletions

View File

@ -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)
}
var poll *common.Poll
var poll common.Poll
if topic.Poll != 0 {
poll, err = common.Polls.Get(topic.Poll)
pPoll, err := common.Polls.Get(topic.Poll)
if err != nil {
log.Print("Couldn't find the attached poll for topic " + strconv.Itoa(topic.ID))
return common.InternalError(err, w, r)
}
poll = pPoll.Copy()
}
// Calculate the offset
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..
rows, err := stmts.getTopicRepliesOffset.Query(topic.ID, offset, common.Config.ItemsPerPage)

View File

@ -535,6 +535,10 @@ input[type=checkbox]:checked + label .sel {
display: none;
}
.poll_option_text {
font-size: 15px;
}
.formbutton {
margin-top: 12px;
margin-left: auto;