PrestaShop/PrestaShop — pull request #2306 by studiokiwik (2014-12-02 09:15:34+00:00)
Title: [CORE] Managed case when there is no order created

Even if there is no order created (because all packages are empty, which shouldn't be happening but yet it happens, when there is problem with carrier for example), code assumes that variable $order exists and it's initialized anyway (line 411 for example, $order->addOrderPayment), which leads to unexpected but fatal errors.
This is fast patch. One can also consider to create empty order in such case.