mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-04 06:44:40 +01:00
more null checking
This commit is contained in:
parent
404ce0212c
commit
d611992018
1 changed files with 2 additions and 0 deletions
|
@ -55,6 +55,7 @@ public class SimpleRegistryImpl<K, V> implements SimpleRegistry<K, V> {
|
|||
@Override
|
||||
@Nullable
|
||||
public synchronized V get(K object) {
|
||||
Objects.requireNonNull(object, "object");
|
||||
if (this.registrations.containsKey(object)) {
|
||||
return this.registrations.get(object);
|
||||
} else if (this.providedValues.containsKey(object)) {
|
||||
|
@ -81,6 +82,7 @@ public class SimpleRegistryImpl<K, V> implements SimpleRegistry<K, V> {
|
|||
@Nullable
|
||||
@SuppressWarnings("unchecked")
|
||||
public synchronized V get(StateHolder<K, ?> state) {
|
||||
Objects.requireNonNull(state, "state");
|
||||
K owner = ((StateHolderAccessor<K, ?>) state).getOwner();
|
||||
return this.get(owner);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue