Skip to content

Commit

Permalink
solve issue #1937 (NPE in FbxObject)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jan 29, 2023
1 parent 7a5d085 commit 5a96964
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2021 jMonkeyEngine
* Copyright (c) 2009-2023 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -257,8 +257,23 @@ private void connectObjects(FbxElement element) {
parentId = FbxId.create(el.properties.get(2));
String propName = (String) el.properties.get(3);
FbxObject child = objectMap.get(childId);
if (child == null) {
logger.log(Level.WARNING,
"Missing child object with ID {0}. Skipping object-"
+ "property connection for property \"{1}\"",
new Object[]{childId, propName});
}
FbxObject parent = objectMap.get(parentId);
parent.connectObjectProperty(child, propName);
if (parent == null) {
logger.log(Level.WARNING,
"Missing parent object with ID {0}. Skipping object-"
+ "property connection for property \"{1}\"",
new Object[]{parentId, propName});
}
if (parent != null && child != null) {
parent.connectObjectProperty(child, propName);
}

} else {
logger.log(Level.WARNING, "Unknown connection type: {0}. Ignoring.", type);
}
Expand Down

0 comments on commit 5a96964

Please sign in to comment.