Prechádzať zdrojové kódy

check that shaders list is not null
(it is null on js target for some objects)

Ivan Tivonenko 11 rokov pred
rodič
commit
77e07a72b2
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      h2d/Drawable.hx

+ 1 - 1
h2d/Drawable.hx

@@ -94,7 +94,7 @@ class Drawable extends Sprite {
 	}
 	}
 
 
 	public function getShader< T:hxsl.Shader >( stype : Class<T> ) : T {
 	public function getShader< T:hxsl.Shader >( stype : Class<T> ) : T {
-		for( s in shaders )
+		if (shaders != null) for( s in shaders )
 			if( Std.is(s, stype) )
 			if( Std.is(s, stype) )
 				return cast s;
 				return cast s;
 		return null;
 		return null;