From 786c2947315ab2d6cc2b5664a6b7374457dc7217 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 11 May 2006 08:30:40 +0000
Subject: [PATCH] Check delivery is not None before calling a getProperty on it

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7180 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/InvoiceTransactionRule.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/Document/InvoiceTransactionRule.py b/product/ERP5/Document/InvoiceTransactionRule.py
index 3031c59aab..292b2c981b 100644
--- a/product/ERP5/Document/InvoiceTransactionRule.py
+++ b/product/ERP5/Document/InvoiceTransactionRule.py
@@ -141,7 +141,8 @@ class InvoiceTransactionRule(Rule, PredicateMatrix):
               while resource is None and \
                           simulation_movement != portal_simulation :
                 delivery = simulation_movement.getDeliveryValue()
-                resource = delivery.getProperty('price_currency', None)
+                if delivery is not None:
+                  resource = delivery.getProperty('price_currency', None)
                 if simulation_movement.getParentValue().getParentValue() \
                                           == portal_simulation :
                   # we are on the first simulation movement, we'll try
-- 
2.30.9