summaryrefslogtreecommitdiff
path: root/libmate-desktop
diff options
context:
space:
mode:
authorMonsta <[email protected]>2014-11-08 15:24:59 +0300
committerStefano Karapetsas <[email protected]>2014-11-28 08:39:39 +0100
commit48df7a0c71a2df4050abae40ec9ca2b35dee7988 (patch)
tree5a6e1ce117ba9bc415f0656d436c26050d003c33 /libmate-desktop
parent91871522b5d33dd4d762b28837039ecba2575d4b (diff)
downloadmate-desktop-48df7a0c71a2df4050abae40ec9ca2b35dee7988.tar.bz2
mate-desktop-48df7a0c71a2df4050abae40ec9ca2b35dee7988.tar.xz
changed checking for NULL a bit
the code below clearly assumes that slide should never be NULL, so the check is now done via g_return_if_fail Closes https://github.com/mate-desktop/mate-desktop/pull/143
Diffstat (limited to 'libmate-desktop')
-rw-r--r--libmate-desktop/mate-bg.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
index 2ff4e92..692992e 100644
--- a/libmate-desktop/mate-bg.c
+++ b/libmate-desktop/mate-bg.c
@@ -2855,10 +2855,15 @@ handle_text (GMarkupParseContext *context,
GError **err)
{
SlideShow *parser = user_data;
- Slide *slide = parser->slides->tail? parser->slides->tail->data : NULL;
FileSize *fs;
gint i;
+ g_return_if_fail (parser != NULL);
+ g_return_if_fail (parser->slides != NULL);
+ g_return_if_fail (parser->slides->tail != NULL);
+
+ Slide *slide = parser->slides->tail->data;
+
if (stack_is (parser, "year", "starttime", "background", NULL)) {
parser->start_tm.tm_year = parse_int (text) - 1900;
}