From ef5bdcb0f07c30c732bcfea15cf9d3163e55bdfd Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 6 Mar 2014 20:35:55 +0100 Subject: [PATCH] check if order already existsin session before using it --- core/lib/Thelia/Core/HttpFoundation/Session/Session.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/lib/Thelia/Core/HttpFoundation/Session/Session.php b/core/lib/Thelia/Core/HttpFoundation/Session/Session.php index b35bd4a13..df5fa6a38 100644 --- a/core/lib/Thelia/Core/HttpFoundation/Session/Session.php +++ b/core/lib/Thelia/Core/HttpFoundation/Session/Session.php @@ -250,7 +250,14 @@ class Session extends BaseSession */ public function getOrder() { - return $this->get("thelia.order"); + $order = $this->get("thelia.order"); + + if (null === $order) { + $order = new Order(); + $this->setOrder($order); + } + + return $order; } /**