fix a segfault when saving null images

This commit is contained in:
Chris Beck 2015-04-16 20:23:09 -04:00
parent 83e1b59b78
commit 14d49d3267

View file

@ -1263,6 +1263,9 @@ bool save_image(const locator & i_locator, const std::string & filename)
bool save_image(const surface & surf, const std::string & filename)
{
if (surf.null()) {
return false;
}
#ifdef HAVE_LIBPNG
if (!filesystem::ends_with(filename, ".bmp")) {
LOG_DP << "Writing a png image to " << filename << std::endl;