Author: Hugo Melo <hugo@riseup.net>
Fix order view js when order is nil
plugins/orders_cycle/views/orders_cycle_plugin_order/edit.js.erb | 2 +-
diff --git a/plugins/orders_cycle/views/orders_cycle_plugin_order/edit.js.erb b/plugins/orders_cycle/views/orders_cycle_plugin_order/edit.js.erb index 911be165e52b1599f3b2362a76f7f33781ba7e39..b14278d19f83b5781ed309d9da50cf16a1a24e7c 100644 --- a/plugins/orders_cycle/views/orders_cycle_plugin_order/edit.js.erb +++ b/plugins/orders_cycle/views/orders_cycle_plugin_order/edit.js.erb @@ -1,4 +1,4 @@ -jQuery('#order-<%=@order.id%>').replaceWith("<%= j render('orders_cycle_plugin_order/active_order', :order => @order, :actor_name => @actor_name) %>"); +jQuery('#order-<%=@order&.id%>').replaceWith("<%= j render('orders_cycle_plugin_order/active_order', :order => @order, :actor_name => @actor_name) %>"); orders_cycle.order.product.setEditable(<%=@order.may_edit?(user, @admin).to_json%>)