|
1 | 1 | /* |
2 | | - * Copyright (c) 2009-2021 jMonkeyEngine |
| 2 | + * Copyright (c) 2009-2023 jMonkeyEngine |
3 | 3 | * All rights reserved. |
4 | 4 | * |
5 | 5 | * Redistribution and use in source and binary forms, with or without |
@@ -257,8 +257,23 @@ private void connectObjects(FbxElement element) { |
257 | 257 | parentId = FbxId.create(el.properties.get(2)); |
258 | 258 | String propName = (String) el.properties.get(3); |
259 | 259 | FbxObject child = objectMap.get(childId); |
| 260 | + if (child == null) { |
| 261 | + logger.log(Level.WARNING, |
| 262 | + "Missing child object with ID {0}. Skipping object-" |
| 263 | + + "property connection for property \"{1}\"", |
| 264 | + new Object[]{childId, propName}); |
| 265 | + } |
260 | 266 | FbxObject parent = objectMap.get(parentId); |
261 | | - parent.connectObjectProperty(child, propName); |
| 267 | + if (parent == null) { |
| 268 | + logger.log(Level.WARNING, |
| 269 | + "Missing parent object with ID {0}. Skipping object-" |
| 270 | + + "property connection for property \"{1}\"", |
| 271 | + new Object[]{parentId, propName}); |
| 272 | + } |
| 273 | + if (parent != null && child != null) { |
| 274 | + parent.connectObjectProperty(child, propName); |
| 275 | + } |
| 276 | + |
262 | 277 | } else { |
263 | 278 | logger.log(Level.WARNING, "Unknown connection type: {0}. Ignoring.", type); |
264 | 279 | } |
|
0 commit comments