Jelajahi Sumber

Fix potential null acces

ShiroSmith 6 tahun lalu
induk
melakukan
3e9bc14a1d
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      h3d/scene/pbr/Renderer.hx

+ 1 - 1
h3d/scene/pbr/Renderer.hx

@@ -243,7 +243,7 @@ class Renderer extends h3d.scene.Renderer {
 		var ls = Std.instance(getLightSystem(), LightSystem);
 		var ls = Std.instance(getLightSystem(), LightSystem);
 		var count = ctx.engine.drawCalls;
 		var count = ctx.engine.drawCalls;
 		if( ls != null ) drawShadows(ls);
 		if( ls != null ) drawShadows(ls);
-		ctx.lightSystem.drawPasses = ctx.engine.drawCalls - count;
+		if( ctx.lightSystem != null ) ctx.lightSystem.drawPasses = ctx.engine.drawCalls - count;
 
 
 		setTargets([albedo,normal,pbr,other]);
 		setTargets([albedo,normal,pbr,other]);
 		clear(0, 1, 0);
 		clear(0, 1, 0);