Commit 65b9e90a196c0d79a2b72df7e02e451bac233499

Authored by Rodrigo Souto
1 parent d1ce6d4d

Avoid crash on article allow_edit if there is no user

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
app/models/article.rb
@@ -515,7 +515,7 @@ class Article < ActiveRecord::Base @@ -515,7 +515,7 @@ class Article < ActiveRecord::Base
515 end 515 end
516 516
517 def allow_edit_topic?(user) 517 def allow_edit_topic?(user)
518 - self.belongs_to_forum? && (user == author) && user.is_member_of?(profile) 518 + self.belongs_to_forum? && (user == author) && user.present? && user.is_member_of?(profile)
519 end 519 end
520 520
521 def moderate_comments? 521 def moderate_comments?