 			
 			var material : Material = mesh.material;
 			
-			if (material && material.effect)
-				removeDrawCalls(mesh, material.effect);
+			if (!material)
+                return ;
+            
+            var effect  : Effect    = material.effect;
+            
+            if (!effect)
+                return ;
+            
+			removeDrawCalls(mesh, material.effect);
 		}
 		
 		private function effectPassesChangedHandler(effect : Effect) : void

				{
					var drawCall			: DrawCall			= drawCalls[drawCallId];
					var meshBindings		: DataBindings		= _drawCallToMeshBindings[drawCall];
					var meshGeometry		: Geometry			= Mesh(_meshBindingsToMesh[meshBindings]).geometry
					var meshChanges			: Vector.<String>	= _stashedPropertyChanges[meshBindings];
					
					var needUpdateFromMesh	: Boolean 			= meshChanges != null ?

		
		private var _lastViewportWidth			: Number;
		private var _lastViewportHeight			: Number;
		
		/**
		 * Index meshes by their effect.
