Commit 08c482b8 authored by Rubén Dávila's avatar Rubén Dávila

Check if object respond to #touch before update.

parent 78754cb1
...@@ -11,8 +11,9 @@ module Notes ...@@ -11,8 +11,9 @@ module Notes
# Skip system notes, like status changes and cross-references and awards # Skip system notes, like status changes and cross-references and awards
unless note.system || note.is_award unless note.system || note.is_award
event = event_service.leave_note(note, note.author) event = event_service.leave_note(note, note.author)
noteable = note.noteable
note.noteable.touch if event.commented? noteable.touch if event.commented? && noteable.respond_to?(:touch)
note.create_cross_references! note.create_cross_references!
execute_hooks(note) execute_hooks(note)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment