dev@grizzly.java.net

A NullPointerException in DataHandler

From: <Shing-Wai.Chan_at_Sun.COM>
Date: Thu, 01 May 2008 13:31:28 -0700

Hi,
I just see a NullPointerException in DataHandler.java.

The following is my proposal fix:
 /export/grizzly/src/trunk/modules/cometd/src/main/java/com/sun/grizzly/cometd
> svn diff DataHandler.java
Index: DataHandler.java
===================================================================
--- DataHandler.java (revision 1115)
+++ DataHandler.java (working copy)
@@ -82,7 +82,10 @@
         try{
             if (obj instanceof DeliverResponse){
                 DeliverResponse deliverRes = (DeliverResponse)obj;
- if (deliverRes.getClientId().equals(getClientId())){
+ String deliverResClientId = deliverRes.getClientId();
+ if ((deliverResClientId != null &&
+ deliverResClientId.equals(getClientId()) ||
+ deliverResClientId == null && getClientId() ==
null)) {
                     return;
                 }
                 res.write(deliverRes.toJSON());

Regards,
      Shing Wai Chan