mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-02 09:54:50 +00:00
generic tag editor fix when list field is null. For example PlaceObject3Tag.surfaceFilterList
This commit is contained in:
@@ -601,7 +601,16 @@ public class GenericTagTreePanel extends GenericTagPanel {
|
||||
return 0;
|
||||
}
|
||||
Field field = fnode.field;
|
||||
if (ReflectionTools.needsIndex(field) && (fnode.index == -1)) { //Arrays ot Lists
|
||||
if (ReflectionTools.needsIndex(field) && (fnode.index == -1)) { //Arrays or Lists
|
||||
try {
|
||||
if (field.get(fnode.obj) == null) {
|
||||
// todo: instanciate the (Array)List or Array to allow adding items to it
|
||||
return 0;
|
||||
}
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ReflectionTools.getFieldSubSize(fnode.obj, field);
|
||||
}
|
||||
parent = fnode.getValue();
|
||||
|
||||
Reference in New Issue
Block a user