aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/select-names
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-08-30 11:39:57 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-08-30 11:39:57 +0800
commit1cae0f1a15d107fd0f514b8a64ecfdf4af4768be (patch)
treeadaaf29a050b5ec4e80667476e160e7ae55ceca6 /addressbook/gui/component/select-names
parente4c70cd2f525f80332946c788dc57b38e2926eba (diff)
downloadgsoc2013-evolution-1cae0f1a15d107fd0f514b8a64ecfdf4af4768be.tar.gz
gsoc2013-evolution-1cae0f1a15d107fd0f514b8a64ecfdf4af4768be.tar.zst
gsoc2013-evolution-1cae0f1a15d107fd0f514b8a64ecfdf4af4768be.zip
Make sure that comp->priv->query_text isn't NULL. (Fixes bug #8195)
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) svn path=/trunk/; revision=12524
Diffstat (limited to 'addressbook/gui/component/select-names')
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.c11
1 files changed, 8 insertions, 3 deletions
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;