From 71813d0044cb0a3c075a85554237a9e1cf2ee42d Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Fri, 16 Jul 2004 09:03:29 +0000
Subject: [PATCH] Check the length of selected_stats more carefully, because it
 is empty when it is the first time to visit Parameter.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1199 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/skins/erp5_html_style/form_list_ui.pt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/skins/erp5_html_style/form_list_ui.pt b/product/ERP5/skins/erp5_html_style/form_list_ui.pt
index 22ba4129e9..ba6243bcc1 100755
--- a/product/ERP5/skins/erp5_html_style/form_list_ui.pt
+++ b/product/ERP5/skins/erp5_html_style/form_list_ui.pt
@@ -78,11 +78,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
             &nbsp;
            <select name="stat_columns">
               <span tal:repeat="stat stats">
-              <span tal:condition="python: stat == selected_stats[row_index - 1]">
+              <span tal:condition="python: len(selected_stats) >= row_index and stat == selected_stats[row_index - 1]">
               <option tal:content="stat" tal:attributes="value stat" value="None" selected>
               </option>
               </span>
-              <span tal:condition="python: stat != selected_stats[row_index - 1]">
+              <span tal:condition="python: len(selected_stats) < row_index or stat != selected_stats[row_index - 1]">
               <option tal:content="stat" tal:attributes="value stat" value="None">
               </option>
               </span>
-- 
2.30.9