diff --git a/common/draw.c b/common/draw.c index df35f64a7..66f909a52 100644 --- a/common/draw.c +++ b/common/draw.c @@ -826,8 +826,8 @@ draw_imlib_load_strerror(Imlib_Load_Error e) * \param filename The image file to load. * \return A new image. */ -draw_image_t -*draw_image_new(const char *filename) +draw_image_t * +draw_image_new(const char *filename) { int w, h, size, i; DATA32 *data; @@ -837,6 +837,9 @@ draw_image_t Imlib_Load_Error e = IMLIB_LOAD_ERROR_NONE; draw_image_t *image; + if(!filename) + return NULL; + if(!(imimage = imlib_load_image_with_error_return(filename, &e))) { warn("cannot load image %s: %s", filename, draw_imlib_load_strerror(e));