From 0bb61545fac9b7db7f6b48dcfb6d5e503a7d08f5 Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Mon, 8 Mar 2004 18:09:48 +0000
Subject: [PATCH] Return an empty list when failing in getting a selection.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@559 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/SelectionTool.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/product/ERP5Form/SelectionTool.py b/product/ERP5Form/SelectionTool.py
index 8ec6aedcee..4b5e1818b0 100755
--- a/product/ERP5Form/SelectionTool.py
+++ b/product/ERP5Form/SelectionTool.py
@@ -665,6 +665,8 @@ class SelectionTool( UniqueObject, SimpleItem ):
         Get the list of values selected for 'selection_name'
       """
       selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
+      if selection is None:
+        return []
       return selection(selection_method=selection_method, context=context, REQUEST=REQUEST)
 
     security.declareProtected(ERP5Permissions.View, 'getSelectionCheckedValueList')
@@ -673,6 +675,8 @@ class SelectionTool( UniqueObject, SimpleItem ):
         Get the list of values checked for 'selection_name'
       """
       selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
+      if selection is None:
+        return []
       uid_list = selection.getSelectionCheckedUids()
       value_list = self.portal_catalog.getObjectList(uid_list)
       return value_list
-- 
2.30.9