Avoid NPE when batch passed in was null.

This commit is contained in:
Greg Burd 2018-03-05 08:37:48 -05:00
parent ef455ac032
commit 6c245c121e

View file

@ -474,12 +474,14 @@ public abstract class AbstractUnitOfWork<E extends Exception>
} }
private void addBatched(BatchOperation batch) { private void addBatched(BatchOperation batch) {
if (batch != null) {
if (this.batch == null) { if (this.batch == null) {
this.batch = batch; this.batch = batch;
} else { } else {
this.batch.addAll(batch); this.batch.addAll(batch);
} }
} }
}
/* Explicitly discard the work and mark it as as such in the log. */ /* Explicitly discard the work and mark it as as such in the log. */
public synchronized void abort() { public synchronized void abort() {