diff --git a/src/main/java/ai/nets/samj/communication/model/SAM2Small.java b/src/main/java/ai/nets/samj/communication/model/SAM2Small.java index 1cb82a5..a743224 100644 --- a/src/main/java/ai/nets/samj/communication/model/SAM2Small.java +++ b/src/main/java/ai/nets/samj/communication/model/SAM2Small.java @@ -240,7 +240,8 @@ public void notifyUiHasBeenClosed() { * {@inheritDoc} */ public void closeProcess() { - efficientSamJ.close(); + if (efficientSamJ != null) + efficientSamJ.close(); efficientSamJ = null; }