summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmate-desktop/mate-bg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
index 46086d5..5d32425 100644
--- a/libmate-desktop/mate-bg.c
+++ b/libmate-desktop/mate-bg.c
@@ -2316,7 +2316,7 @@ find_best_size (GSList *sizes, gint width, gint height)
best = size;
}
else if (d == distance) {
- if (abs (size->width - width) < abs (best->width - width)) {
+ if (best && (abs (size->width - width) < abs (best->width - width))) {
best = size;
}
}