GP-0: Fix NPE in DependentServiceResolver

This commit is contained in:
Dan
2025-04-14 13:16:46 +00:00
parent f00de10f31
commit 7d5e8639d3
@@ -144,12 +144,15 @@ public class DependentServiceResolver<T> {
constructed.put(cons.method, service);
}
instancesByClass.put(cons.cls, service);
for (Field f : fieldsByClass.remove(cons.cls)) {
try {
f.set(obj, service);
}
catch (IllegalArgumentException | IllegalAccessException e) {
throw new AssertionError(e);
Set<Field> fields = fieldsByClass.remove(cons.cls);
if (fields != null) {
for (Field f : fields) {
try {
f.set(obj, service);
}
catch (IllegalArgumentException | IllegalAccessException e) {
throw new AssertionError(e);
}
}
}
}