spree/spree — pull request #2287 by ElliotGage (2012-12-05 22:38:12+00:00)
Title: Update core/app/views/spree/shared/_google_analytics.html.erb

If an error occurs during the final page of the checkout - order_path(@order), this leaves the flash[:commerce_tracking] set. So when the user goes back to the home page or any subsequent page, the pages will throw an nil exception on <%= @order.number %> because the framework sees that the flash[:commerce_tracking] hasn't been cleared.

The fix is to also check that @order is present.