small fix for deleting category if not present

This commit is contained in:
harrybomrah committed 2016-01-27 13:08:32 +08:00
1 parent 28163dbeba
commit 3abcd5a09a
1 file changed
+1 -1
@@ -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