Skip to content

Commit 4926ccf

Browse files
committed
SyncServerImpl: isRunning() should not throw if closed objectbox-java#252
1 parent 6c3dca7 commit 4926ccf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

objectbox-java/src/main/java/io/objectbox/sync/server/SyncServerImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ public int getPort() {
8080

8181
@Override
8282
public boolean isRunning() {
83-
return nativeIsRunning(getHandle());
83+
long handle = this.handle; // Do not call getHandle() as it throws if handle is 0
84+
return handle != 0 && nativeIsRunning(handle);
8485
}
8586

8687
@Override

0 commit comments

Comments
 (0)