diff --git a/src/display.hpp b/src/display.hpp index 6f4edffec91f..f5443dad8b76 100644 --- a/src/display.hpp +++ b/src/display.hpp @@ -901,6 +901,10 @@ class display : public filter_context, public video2::draw_layering template void render_scaled_to_zoom(const texture& tex, const int x_pos, const int y_pos, T&&... extra_args) const { + if(tex.null()) { + return; + } + texture::info info = tex.get_info(); // Scale the coordinates to the appropriate zoom factor. @@ -928,6 +932,10 @@ class display : public filter_context, public video2::draw_layering template void render_scaled_to_zoom(const texture& tex, const map_location& loc, T&&... extra_args) const { + if(tex.null()) { + return; + } + SDL_Point origin = get_loc_drawing_origin(loc); render_scaled_to_zoom(tex, origin.x, origin.y, std::forward(extra_args)...);