Use safe navigation operator to make rubocop happy

This commit is contained in:
winniehell 2017-02-13 13:02:53 +01:00
parent 2cb70671f3
commit 81eae63b7a
2 changed files with 2 additions and 2 deletions

View File

@ -126,7 +126,7 @@ class Environment < ActiveRecord::Base
return unless available? return unless available?
stop! stop!
stop_action.play(current_user) if stop_action stop_action&.play(current_user)
end end
def actions_for(environment) def actions_for(environment)

View File

@ -15,7 +15,7 @@ module Issues
def before_create(issuable) def before_create(issuable)
if @recaptcha_verified if @recaptcha_verified
spam_log = current_user.spam_logs.find_by(id: @spam_log_id, title: issuable.title) spam_log = current_user.spam_logs.find_by(id: @spam_log_id, title: issuable.title)
spam_log.update!(recaptcha_verified: true) if spam_log spam_log&.update!(recaptcha_verified: true)
else else
issuable.spam = spam_service.check(@api) issuable.spam = spam_service.check(@api)
issuable.spam_log = spam_service.spam_log issuable.spam_log = spam_service.spam_log