aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog4
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.c11
2 files changed, 12 insertions, 3 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 68432f6abd..656f02b22b 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,9 @@
2001-08-29 Jon Trowbridge <trow@ximian.com>
+ * gui/component/select-names/e-select-names-completion.c
+ (book_query_score): Make sure that comp->priv->query_text isn't
+ NULL. (Fixes bug #8195)
+
* backend/ebook/e-book-listener.c (e_book_listener_check_queue):
This function can be re-entrant during the signal emission; Added
extra ref/unrefs and checks to avoid problems if this happens.
diff --git a/addressbook/gui/component/select-names/e-select-names-completion.c b/addressbook/gui/component/select-names/e-select-names-completion.c
index 9e955338b3..b853dbe835 100644
--- a/addressbook/gui/component/select-names/e-select-names-completion.c
+++ b/addressbook/gui/component/select-names/e-select-names-completion.c
@@ -135,10 +135,12 @@ static ECompletionMatch *
match_nickname (ESelectNamesCompletion *comp, EDestination *dest)
{
ECompletionMatch *match = NULL;
- gint len = strlen (comp->priv->query_text);
+ gint len;
ECard *card = e_destination_get_card (dest);
double score;
+ len = strlen (comp->priv->query_text);
+
if (card->nickname
&& !g_utf8_strncasecmp (comp->priv->query_text, card->nickname, len)) {
ECompletionMatch *match = g_new0 (ECompletionMatch, 1);
@@ -555,9 +557,12 @@ book_query_score (ESelectNamesCompletion *comp, EDestination *dest)
ECompletionMatch *best_match = NULL;
gint i;
- g_return_val_if_fail (comp && E_IS_SELECT_NAMES_COMPLETION (comp), NULL);
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
+ g_return_val_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp), NULL);
+ g_return_val_if_fail (E_IS_DESTINATION (dest), NULL);
+ if (! (comp->priv->query_text && *comp->priv->query_text))
+ return NULL;
+
for (i=0; i<book_query_count; ++i) {
ECompletionMatch *this_match = NULL;