[refactor] Add !=nil check in renderCreateSuccess

This commit is contained in:
Daan Sprenkels 2019-12-16 11:26:30 +05:30
parent ca859adab1
commit 087b9920e6
1 changed files with 3 additions and 0 deletions

View File

@ -155,6 +155,9 @@ func (rl *rushlink) renderInternalServerError(w http.ResponseWriter, r *http.Req
}
func (rl *rushlink) renderCreateSuccess(w http.ResponseWriter, r *http.Request, paste *db.Paste, fu *db.FileUpload) {
if paste == nil {
panic("paste should not be nil")
}
var fileExt string
if fu != nil {
fileExt = fu.Ext()