mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-28 07:55:42 +08:00
GP-0: Fix NPE in DependentServiceResolver
This commit is contained in:
+9
-6
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user