From 6c245c121ee849e017d3eaf0c92af059f3fdb88b Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Mon, 5 Mar 2018 08:37:48 -0500 Subject: [PATCH] Avoid NPE when batch passed in was null. --- src/main/java/net/helenus/core/AbstractUnitOfWork.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/helenus/core/AbstractUnitOfWork.java b/src/main/java/net/helenus/core/AbstractUnitOfWork.java index 614a5d5..51ec9cc 100644 --- a/src/main/java/net/helenus/core/AbstractUnitOfWork.java +++ b/src/main/java/net/helenus/core/AbstractUnitOfWork.java @@ -474,10 +474,12 @@ public abstract class AbstractUnitOfWork } private void addBatched(BatchOperation batch) { - if (this.batch == null) { - this.batch = batch; - } else { - this.batch.addAll(batch); + if (batch != null) { + if (this.batch == null) { + this.batch = batch; + } else { + this.batch.addAll(batch); + } } }