Commit 1555d380 authored by E. Levi Allen's avatar E. Levi Allen

Addressing PR Comment About nil return

parent b3924210
Pipeline #26468384 failed with stages
in 50 minutes and 13 seconds
......@@ -145,7 +145,10 @@ module QuickActions
extract_users(pong_param)
end
command :pong do
@updates[:assignee_ids] = [find_previous_assignee(issuable).id]
previous_assignee = find_previous_assignee(issuable)
next if previous_assignee == ""
@updates[:assignee_ids] = [previous_assignee.author.id]
end
desc do
......@@ -624,8 +627,8 @@ module QuickActions
end
def find_previous_assignee(merge_request)
merge_request.notes.system.where("note like ? and author_id != ?",
"%assigned to @#{current_user.username}%", current_user.id).last.author
merge_request.notes.system.find_by("note like ? and author_id != ?",
"%assigned to @#{current_user.username}%", current_user.id) || ""
end
def find_pong_recipient(project, params = {})
......
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