From ab3b15e13e67e621c43379b4b1ea131db98221d4 Mon Sep 17 00:00:00 2001 From: Zanz2 Date: Tue, 21 Aug 2018 13:26:16 +0200 Subject: [PATCH] Found the bug and fixed it --- app/controllers/steps_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/steps_controller.rb b/app/controllers/steps_controller.rb index 85fa0daa3..18be89850 100644 --- a/app/controllers/steps_controller.rb +++ b/app/controllers/steps_controller.rb @@ -515,6 +515,7 @@ class StepsController < ApplicationController params[:tables_attributes].each do |_, table| next unless table['_destroy'] table_to_destroy = Table.find_by_id(table['id']) + next if table_to_destroy.nil? table_to_destroy.report_elements.destroy_all end end