Skip to content

Commit

Permalink
Fix null check
Browse files Browse the repository at this point in the history
  • Loading branch information
ousttrue committed Feb 6, 2019
1 parent 8c363d5 commit 038b3c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Assets/VRM/UniGLTF/Scripts/IO/MaterialImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public virtual Material CreateMaterial(int i, glTFMaterial x)
material.SetColor("_EmissionColor", new Color(x.emissiveFactor[0], x.emissiveFactor[1], x.emissiveFactor[2]));
}

if (x.emissiveTexture.index != -1)
if (x.emissiveTexture != null && x.emissiveTexture.index != -1)
{
var texture = Context.GetTexture(x.emissiveTexture.index);
if (texture != null)
Expand Down

0 comments on commit 038b3c0

Please sign in to comment.