couchbaselabs/TouchDB-Android — pull request #66 by pegli (2012-08-09 16:25:21+00:00)
Title: fix for NPE in TDBatcher

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.