mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 21:31:53 +01:00
Fix IllegalStateException in WatchServiceImpl (#3389)
Added a check to prevent attempts to unregister already unregistered service Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
parent
07e8ff56c7
commit
278e99b461
@ -162,7 +162,7 @@ public class WatchServiceImpl implements WatchService, DirectoryChangeListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ServiceRegistration<?> localReg = this.reg;
|
ServiceRegistration<?> localReg = this.reg;
|
||||||
if (localReg != null) {
|
if (localReg != null && bundleContext.getService(localReg.getReference()) != null) {
|
||||||
localReg.unregister();
|
localReg.unregister();
|
||||||
this.reg = null;
|
this.reg = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user