changeset 1687:fc88516f2993

fixed an use of uninitialized value
author Vladimir Nadvornik <nadvornik@suse.cz>
date Tue, 30 Jun 2009 20:15:33 +0000
parents 4cb7c2245306
children 1c9574b3da71
files src/metadata.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/metadata.c	Tue Jun 30 20:12:28 2009 +0000
+++ b/src/metadata.c	Tue Jun 30 20:15:33 2009 +0000
@@ -334,7 +334,7 @@
 
 	have_keywords = g_hash_table_lookup_extended(fd->modified_xmp, KEYWORD_KEY, NULL, &keywords);
 	have_comment = g_hash_table_lookup_extended(fd->modified_xmp, COMMENT_KEY, NULL, &comment_l);
-	comment = comment_l ? ((GList *)comment_l)->data : NULL;
+	comment = (have_comment && comment_l) ? ((GList *)comment_l)->data : NULL;
 	
 	if (!have_keywords || !have_comment) metadata_file_read(metadata_pathl, &orig_keywords, &orig_comment);