diff --git a/src/SFML/Graphics/Sprite.cpp b/src/SFML/Graphics/Sprite.cpp index 21db6ef17..a4c88fdc7 100644 --- a/src/SFML/Graphics/Sprite.cpp +++ b/src/SFML/Graphics/Sprite.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -128,6 +129,8 @@ FloatRect Sprite::getGlobalBounds() const //////////////////////////////////////////////////////////// void Sprite::draw(RenderTarget& target, RenderStates states) const { + assert(m_texture->getNativeHandle() != 0 && "Sprite::draw() Cannot draw sprite when texture is not initialized"); + states.transform *= getTransform(); states.texture = m_texture; states.coordinateType = CoordinateType::Pixels;