[evolution-data-server] Bug #652172 - Fix a regression from the previous commit



commit 6241ddbdde9f2aae9ac51d6112f7c3009d2d41d2
Author: Milan Crha <mcrha redhat com>
Date:   Thu Aug 4 16:04:00 2011 +0200

    Bug #652172 - Fix a regression from the previous commit

 .../libedata-book/e-book-backend-sqlitedb.c        |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index acc14be..04a9216 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -1012,6 +1012,9 @@ e_book_backend_sqlitedb_is_summary_query (const gchar *query, GHashTable *fields
 	gint i;
 	gint esexp_error;
 
+	g_return_val_if_fail (query != NULL, FALSE);
+	g_return_val_if_fail (*query, FALSE);
+
 	fields_are_summary = 
 		(fields_of_interest && book_backend_sqlitedb_is_summary_fields (fields_of_interest));
 
@@ -1424,7 +1427,7 @@ e_book_backend_sqlitedb_search	(EBookBackendSqliteDB *ebsdb,
 	if (sexp && !*sexp)
 		sexp = NULL;
 
-	if (e_book_backend_sqlitedb_is_summary_query (sexp, fields_of_interest)) {
+	if (!sexp || e_book_backend_sqlitedb_is_summary_query (sexp, fields_of_interest)) {
 		gchar *sql_query;
 
 		sql_query = sexp ? sexp_to_sql_query (sexp) : NULL;
@@ -1451,7 +1454,7 @@ e_book_backend_sqlitedb_search_uids	(EBookBackendSqliteDB *ebsdb,
 	if (sexp && !*sexp)
 		sexp = NULL;
 
-	if (e_book_backend_sqlitedb_is_summary_query (sexp, NULL)) {
+	if (!sexp || e_book_backend_sqlitedb_is_summary_query (sexp, NULL)) {
 		gchar *stmt;
 		gchar *sql_query = sexp ? sexp_to_sql_query (sexp) : NULL;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]