From 3abcd5a09a0a7f35fbf59c35ad4d6b335505eadc Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 27 Jan 2016 13:08:32 +0800 Subject: [PATCH] small fix for deleting category if not present --- app/controllers/admin/universal_tables_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/universal_tables_controller.rb b/app/controllers/admin/universal_tables_controller.rb index 262e8f3..d8aa01b 100644 --- a/app/controllers/admin/universal_tables_controller.rb +++ b/app/controllers/admin/universal_tables_controller.rb @@ -193,7 +193,7 @@ class Admin::UniversalTablesController < OrbitAdminController def destroy uid = params[:id].split("-").last table = UTable.where(:uid => uid).first - table.category.destroy + table.category.destroy if !table.category.nil? table.destroy redirect_to admin_universal_tables_path end