Commit e2af853b authored by Rémy Coutable's avatar Rémy Coutable

Ensure Issuable respond to :total_time_spent before calling it

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 4d1bcae5
......@@ -280,7 +280,7 @@ module Issuable
end
end
if old_total_time_spent != total_time_spent
if self.respond_to?(:total_time_spent) && old_total_time_spent != total_time_spent
changes[:total_time_spent] = [old_total_time_spent, total_time_spent]
end
......
......@@ -174,7 +174,7 @@ class IssuableBaseService < BaseService
old_labels = issuable.labels.to_a
old_mentioned_users = issuable.mentioned_users.to_a
old_assignees = issuable.assignees.to_a
old_total_time_spent = issuable.total_time_spent
old_total_time_spent = issuable.total_time_spent if issuable.respond_to?(:total_time_spent)
label_ids = process_label_ids(params, existing_label_ids: issuable.label_ids)
params[:label_ids] = label_ids if labels_changing?(issuable.label_ids, label_ids)
......
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