Stop spamming the log when there is no image present.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Byron Clark 2008-06-21 22:42:28 -06:00 committed by Julien Danjou
parent e1dd1344fc
commit 7106c9bcad
1 changed files with 5 additions and 2 deletions

View File

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