* fix precondition, which could cause a crash
[modest] / src / modest-utils.c
index 2a5981c..f0eb11e 100644 (file)
@@ -96,7 +96,8 @@ modest_utils_create_temp_stream (const gchar *orig_name, const gchar *hash_base,
        guint hash_number;
 
        /* hmmm... maybe we need a modest_text_utils_validate_file_name? */
-       g_return_val_if_fail (orig_name || strlen(orig_name) == 0, NULL);
+       g_return_val_if_fail (orig_name && strlen(orig_name) != 0, NULL);
+
        if (strlen(orig_name) > 200) {
                g_warning ("%s: filename too long ('%s')",
                           __FUNCTION__, orig_name);