Browse Source

Fix null access on ModelLibrary.hx if no cb on emit

clementlandrin 11 months ago
parent
commit
9fb31f9a4a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      hrt/prefab/l3d/ModelLibrary.hx

+ 2 - 1
hrt/prefab/l3d/ModelLibrary.hx

@@ -44,7 +44,8 @@ class MeshEmitter {
 		for ( i => mat in materials ) {
 			var batch = @:privateAccess libraryInstance.getBatch(batches[i]);
 			libraryInstance.library.emit({ mat : mat, mesh : mesh }, batch, absPos, emitCountTip, batch.meshBatchFlags);
-			cb(batch);
+			if ( cb != null )
+				cb(batch);
 		}
 	}
 }