cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/datatype FlowJXPathSelectionList.java
Date Tue, 03 Feb 2004 18:05:31 GMT
vgritsenko    2004/02/03 10:05:31

  Modified:    src/blocks/woody/java/org/apache/cocoon/woody/datatype
                        FlowJXPathSelectionList.java
  Log:
  Fix NPE in FlowJXPathSelectionList when trying to use null value in selection list
  
  Revision  Changes    Path
  1.6       +7 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/datatype/FlowJXPathSelectionList.java
  
  Index: FlowJXPathSelectionList.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/datatype/FlowJXPathSelectionList.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FlowJXPathSelectionList.java	29 Jan 2004 03:18:05 -0000	1.5
  +++ FlowJXPathSelectionList.java	3 Feb 2004 18:05:31 -0000	1.6
  @@ -146,7 +146,12 @@
   
                   // Get the value as a string
                   Object value = itemCtx.getValue(this.valuePath);
  -                stringValue = this.datatype.convertToString(value, locale);
  +
  +                // List may contain null value, and (per contract with convertors),
  +                // convertors are not invoked on nulls.
  +                if (value != null) {
  +                    stringValue = this.datatype.convertToString(value, locale);
  +                }
   
                   // Get the label (can be ommitted)
                   itemCtx.setLenient(true);
  
  
  

Mime
View raw message