[recipes] Avoid a crash for missing chef images
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Avoid a crash for missing chef images
- Date: Sat, 27 May 2017 15:57:09 +0000 (UTC)
commit 6500e00e709631a4c5bd31ca9cf4b3b561ac49b4
Author: Matthias Clasen <mclasen redhat com>
Date: Sat May 27 11:54:14 2017 -0400
Avoid a crash for missing chef images
We should have a placeholder image, but not having one
is not an excuse for crashing.
src/gr-image.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/gr-image.c b/src/gr-image.c
index 6c62d48..1f12815 100644
--- a/src/gr-image.c
+++ b/src/gr-image.c
@@ -423,6 +423,11 @@ gr_image_load_full (GrImage *ri,
* We used to store them as a relative path starting with images/,
* so try that case as well.
*/
+ if (ri->path == NULL) {
+ g_warning ("No image path");
+ return;
+ }
+
if (ri->path[0] == '/')
local_path = g_strdup (ri->path);
else if (g_str_has_prefix (ri->path, "images/"))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]