From 4eda5ae1c1575ef9de8b72a1c45358e615388fda Mon Sep 17 00:00:00 2001
From: Rafael Monnerat <rafael@nexedi.com>
Date: Fri, 6 Oct 2006 15:30:25 +0000
Subject: [PATCH] Fix when the Category is None and Diverge.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10599 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../ERP5/Document/CategoryDivergenceTester.py | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/product/ERP5/Document/CategoryDivergenceTester.py b/product/ERP5/Document/CategoryDivergenceTester.py
index 4fe99e0a07..8a1a420667 100644
--- a/product/ERP5/Document/CategoryDivergenceTester.py
+++ b/product/ERP5/Document/CategoryDivergenceTester.py
@@ -81,25 +81,25 @@ class CategoryDivergenceTester(PropertyDivergenceTester):
       delivery_mvt_category_list.sort()
       simulation_category_list.sort()
       
-      if delivery_mvt_category_list != simulation_category_list:
-         
+      if delivery_mvt_category_list != simulation_category_list: 
         delivery_mvt_category_title_list = []
         for mvt_category in delivery_mvt_category_list:
           category_value = delivery_mvt.resolveCategory(mvt_category) 
-          if category_value.getPortalType() == 'Category':
-            delivery_mvt_category_title_list.append(category_value.getTranslatedTitle())
-          else:
-            delivery_mvt_category_title_list.append(category_value.getTitle())
+          if category_value is not None:
+            if category_value.getPortalType() == 'Category':
+              delivery_mvt_category_title_list.append(category_value.getTranslatedTitle())
+            else:
+              delivery_mvt_category_title_list.append(category_value.getTitle())
          
-            
         simulation_category_title_list = []
         for mvt_category in simulation_category_list:
           category_value = delivery_mvt.resolveCategory(mvt_category)
-          if category_value.getPortalType() == 'Category':
-            simulation_category_title_list.append(category_value.getTranslatedTitle())
-          else:
-            simulation_category_title_list.append(category_value.getTitle())
-
+          if category_value is not None:
+            if category_value.getPortalType() == 'Category':
+              simulation_category_title_list.append(category_value.getTranslatedTitle())
+            else:
+              simulation_category_title_list.append(category_value.getTitle())
+        
         delivery_mvt_property = ' , '.join(delivery_mvt_category_title_list)
         simulation_mvt_property = ' , '.join(simulation_category_title_list)
         
-- 
2.30.9