fix locked? being called on nil

This commit is contained in:
jomo
2015-01-27 21:46:48 +01:00
parent 374f602163
commit 580db14754

View File

@@ -84,7 +84,7 @@ class ForumthreadsController < ApplicationController
def thread_params(add = [])
a = [:title, :content]
a << :label_id unless @thread.locked?
a << :label_id if @thread && !@thread.locked?
a += add
params.require(:forumthread).permit(a)
end