瀏覽代碼

solve issue #1930 (NPE in FbxLayerElement) (#1931)

Stephen Gold 2 年之前
父節點
當前提交
8861ff5d1a
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxLayerElement.java

+ 2 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxLayerElement.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2023 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -196,7 +196,7 @@ public class FbxLayerElement {
                 layerElement.name = (String) child.properties.get(0);
             }
         }
-        if (layerElement.data == null) {
+        if (layerElement.data == null && layerElement.dataIndices != null) {
             // For Smoothing / Materials, data = dataIndices
             layerElement.refInfoType = ReferenceInformationType.Direct;
             layerElement.data = new Integer[layerElement.dataIndices.length];