Skip to content

Commit

Permalink
Null check
Browse files Browse the repository at this point in the history
  • Loading branch information
Siccity committed Apr 8, 2019
1 parent f736b04 commit 134b25e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Scripts/Editor/GLTFImporterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public void AddTextures(AssetImportContext ctx, GLTFObject gltfObject) {
if (gltfObject.images[i].imageIsAsset) continue;

Texture2D tex = gltfObject.images[i].GetTexture();
if (tex == null) continue;
if (string.IsNullOrEmpty(tex.name)) tex.name = "texture" + i.ToString();
#if UNITY_2018_2_OR_NEWER
ctx.AddObjectToAsset(i.ToString(), tex);
Expand Down

0 comments on commit 134b25e

Please sign in to comment.