fix for NPE in TDBatcher #66

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@pegli
Contributor

pegli commented Aug 9, 2012

I'm not sure how I did it, but I ran into a case where I was getting the following NullPointerException:


     [exec] [DEBUG] E/AndroidRuntime(  340): java.lang.NullPointerException
     [exec] [DEBUG] E/AndroidRuntime(  340):    at com.couchbase.touchdb.support.TDBatcher.flush(TDBatcher.java:75)
     [exec] [DEBUG] E/AndroidRuntime(  340):    at com.couchbase.touchdb.replicator.TDPuller.changeTrackerStopped(TDPuller.java:140)
     [exec] [DEBUG] E/AndroidRuntime(  340):    at com.couchbase.touchdb.replicator.changetracker.TDChangeTracker.stopped(TDChangeTracker.java:304)
     [exec] [DEBUG] E/AndroidRuntime(  340):    at com.couchbase.touchdb.replicator.changetracker.TDChangeTracker.stop(TDChangeTracker.java:297)
     [exec] [DEBUG] E/AndroidRuntime(  340):    at com.couchbase.touchdb.replicator.changetracker.TDChangeTracker.run(TDChangeTracker.java:208)
     [exec] [DEBUG] E/AndroidRuntime(  340):    at java.lang.Thread.run(Thread.java:1096)

Since other parts of TDBatcher were checking to see if the handler object was null, I just added a null check in flush() and it seems to work ok.

@mschoch

This comment has been minimized.

Show comment
Hide comment
@mschoch

mschoch Aug 9, 2012

Member

Thanks, I ran into this same one yesterday. I have the patch in my tree already. Unfortunately the replicator is in a sad place right now. Hopefully I make more tangible progress today.

Member

mschoch commented Aug 9, 2012

Thanks, I ran into this same one yesterday. I have the patch in my tree already. Unfortunately the replicator is in a sad place right now. Hopefully I make more tangible progress today.

@pegli pegli closed this Oct 15, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment