avoid calling author on nil object
Change-Id: I6b6a5fb537a3e6fbd8321d124f3e4e3b905995e7 Reviewed-on: https://gerrit.instructure.com/16335 Reviewed-by: Jon Jensen <jon@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com> Tested-by: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
dc8d35802b
commit
8adadea4ee
|
@ -45,7 +45,7 @@ module StreamItemsHelper
|
|||
end
|
||||
next if participant.last_message.nil? || participant.last_author?
|
||||
item.data.write_attribute(:last_message, participant.last_message)
|
||||
item.data.write_attribute(:last_author, item.data.last_message.author)
|
||||
item.data.write_attribute(:last_author, item.data.last_message.try(:author))
|
||||
|
||||
# because we're cheating and just checking unread here instead of using
|
||||
# the workflow_state on the stream_item_instance, that workflow_state
|
||||
|
|
Loading…
Reference in New Issue