add a check

This commit is contained in:
zimzaza4
2024-09-09 23:24:01 +08:00
parent 54eabdc65a
commit 12116195d4

View File

@@ -54,6 +54,9 @@ public class Animation {
for (Map.Entry<String, JsonElement> anim : bone.getValue().getAsJsonObject().entrySet()) { for (Map.Entry<String, JsonElement> anim : bone.getValue().getAsJsonObject().entrySet()) {
float max = -1; float max = -1;
JsonObject end = null; JsonObject end = null;
if (!anim.getValue().isJsonObject()) {
continue;
}
for (Map.Entry<String, JsonElement> timeline : anim.getValue().getAsJsonObject().entrySet()) { for (Map.Entry<String, JsonElement> timeline : anim.getValue().getAsJsonObject().entrySet()) {
float time = Float.parseFloat(timeline.getKey()); float time = Float.parseFloat(timeline.getKey());
if (time > max) { if (time > max) {