User: sylvain 
  Date: 00/05/26 12:53:03

  Modified:    src/java/org/jaws SQLUtilities.java
  Log:
  bug fixed : if an object is null there was a null pointer exception
  
  Revision  Changes    Path
  1.13      +20 -13    ejboss/src/java/org/jaws/SQLUtilities.java
  
  Index: SQLUtilities.java
  ===================================================================
  RCS file: /products/cvs/ejboss/ejboss/src/java/org/jaws/SQLUtilities.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- SQLUtilities.java 2000/05/22 02:54:40     1.12
  +++ SQLUtilities.java 2000/05/26 19:53:02     1.13
  @@ -41,7 +41,7 @@
    *
    * @author  <a href="mailto:[EMAIL PROTECTED]">Joe Shevland</a>.
    * @author  <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>.
  - * @version $Revision: 1.12 $
  + * @version $Revision: 1.13 $
    * @since   Ejboss 0.9.9
    */
   
  @@ -179,18 +179,25 @@
                       // Get the underlying byte[]
   
                       byte[] bytes = resultSet.getBytes(i);
  -
  -                    // We should really reuse these guys
  -
  -                    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
  -
  -                    // Use the class loader to deserialize
  -
  -                    ObjectInputStream ois = new 
ObjectInputStreamWithClassLoader(bais,cl);
  -
  -                    value = ois.readObject( );
  -
  -                    ois.close();
  +                    
  +                    if( bytes == null )
  +                    {
  +                        value = null;
  +                    }
  +                    else
  +                    {
  +                        // We should really reuse these guys
  +    
  +                        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
  +    
  +                        // Use the class loader to deserialize
  +    
  +                        ObjectInputStream ois = new 
ObjectInputStreamWithClassLoader(bais,cl);
  +    
  +                        value = ois.readObject( );
  +    
  +                        ois.close();
  +                    }
                   }
   
                   else {
  
  
  

Reply via email to