Fixed provider comparison (#1792)

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
Christoph Weitkamp 2020-11-03 18:00:28 +01:00 committed by GitHub
parent 35b0a1275e
commit a598fa94f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -541,7 +541,7 @@ public abstract class AbstractRegistry<@NonNull E extends Identifiable<K>, @NonN
}
protected void unsetManagedProvider(ManagedProvider<E, K> provider) {
if (managedProvider.equals(provider)) {
if (managedProvider.isPresent() && managedProvider.get().equals(provider)) {
managedProvider = Optional.empty();
}
}