tomj        02/02/26 13:15:33

  Modified:    java/src/org/apache/axis/encoding/ser
                        BeanPropertyTarget.java
  Log:
  Don't dereference a null pointer when logging an error in setValue.
  
  Revision  Changes    Path
  1.4       +10 -5     
xml-axis/java/src/org/apache/axis/encoding/ser/BeanPropertyTarget.java
  
  Index: BeanPropertyTarget.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BeanPropertyTarget.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BeanPropertyTarget.java   22 Feb 2002 23:39:44 -0000      1.3
  +++ BeanPropertyTarget.java   26 Feb 2002 21:15:33 -0000      1.4
  @@ -118,11 +118,16 @@
                       field += "[" + index + "]";
                       i = 1;
                   }
  -                log.error(JavaUtils.getMessage("cantConvert02",
  -                                               new String[] {
  -                                                   value.getClass().getName(),
  -                                                   field,
  -                                                   pd.getType().getName()}));
  +                if (log.isErrorEnabled()) {
  +                    String valueType = "null";
  +                    if (value != null)
  +                        valueType = value.getClass().getName();
  +                    log.error(JavaUtils.getMessage("cantConvert02",
  +                                                   new String[] {
  +                                                       valueType,
  +                                                       field,
  +                                                       pd.getType().getName()}));
  +                }
                   throw new SAXException(ex);
               }
           }
  
  
  


Reply via email to