From 7106c9bcad647cfd677257aa9c56506290eeaedc Mon Sep 17 00:00:00 2001 From: Byron Clark Date: Sat, 21 Jun 2008 22:42:28 -0600 Subject: [PATCH] Stop spamming the log when there is no image present. Signed-off-by: Julien Danjou --- common/draw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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));