Fixed the check form in error with specitic cironstances

This commit is contained in:
Colin Darie 2018-08-31 14:40:34 +02:00
parent ccde868457
commit 7d5c7de7fe
No known key found for this signature in database
GPG Key ID: 4FB865FDBCA4BCC4
1 changed files with 1 additions and 1 deletions

View File

@ -116,7 +116,7 @@ class ChecksController < ApplicationController # rubocop:disable Metrics/ClassLe
last_notification = @check.notifications.last
# user has filled a new notification: we use it for the form
if last_notification.new_record?
if last_notification.present? && last_notification.new_record?
@new_notification = last_notification
else # otherwise, set a new empty notification
build_empty_notification