From 7d5c7de7fe53e658d4e679de977d79945640731e Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Fri, 31 Aug 2018 14:40:34 +0200 Subject: [PATCH] Fixed the check form in error with specitic cironstances --- app/controllers/checks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/checks_controller.rb b/app/controllers/checks_controller.rb index 9449b56..e80320f 100644 --- a/app/controllers/checks_controller.rb +++ b/app/controllers/checks_controller.rb @@ -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