]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/texturing.cpp
Avoid accessing a null object if there's only a sampler for some unit
[libs/gl.git] / source / render / texturing.cpp
index ab5d39b4c42e2b38d51c9ba1dfea5258e851a23a..be24d5d72b3a6e4fe2075e30af6f5772113b23a3 100644 (file)
@@ -136,7 +136,10 @@ void Texturing::bind_attachment(const Attachment &attch) const
                attch.sampler->bind_to(attch.unit);
        else
                Sampler::unbind_from(attch.unit);
-       attch.texture->bind_to(attch.unit);
+       if(attch.texture)
+               attch.texture->bind_to(attch.unit);
+       else
+               Texture::unbind_from(attch.unit);
 }
 
 void Texturing::unbind()