[epiphany/history-rewrite] ephy-completion-model: fix warning when a bookmark has no keywords



commit fb2ec9a733d81947fa630edc496ec5418e856c67
Author: Xan Lopez <xan igalia com>
Date:   Mon Mar 5 16:14:45 2012 +0100

    ephy-completion-model: fix warning when a bookmark has no keywords
    
    Values in EphyNode can be NULL, so guard against that.

 src/ephy-completion-model.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/ephy-completion-model.c b/src/ephy-completion-model.c
index 6906926..776f2dd 100644
--- a/src/ephy-completion-model.c
+++ b/src/ephy-completion-model.c
@@ -216,9 +216,9 @@ should_add_bookmark_to_model (EphyCompletionModel *model,
 
     for (iter = priv->search_terms; iter != NULL; iter = iter->next) {
       current = (GRegex*) iter->data;
-      if ((!g_regex_match (current, title, G_REGEX_MATCH_NOTEMPTY, NULL)) &&
-          (!g_regex_match (current, location, G_REGEX_MATCH_NOTEMPTY, NULL)) &&
-          (!g_regex_match (current, keywords, G_REGEX_MATCH_NOTEMPTY, NULL))) {
+      if (((title && !g_regex_match (current, title, G_REGEX_MATCH_NOTEMPTY, NULL))) &&
+          ((location && !g_regex_match (current, location, G_REGEX_MATCH_NOTEMPTY, NULL))) &&
+          ((keywords && !g_regex_match (current, keywords, G_REGEX_MATCH_NOTEMPTY, NULL)))) {
         ret = FALSE;
         break;
       }



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