Fixed coredumping when switching from bookmarks mode to normal search
authorkrzsas <krzsas@gmail.com>
Fri, 10 Aug 2007 14:10:16 +0000 (14:10 +0000)
committerkrzsas <krzsas@gmail.com>
Fri, 10 Aug 2007 14:10:16 +0000 (14:10 +0000)
git-svn-id: file:///svnroot/mdictionary/trunk@170 5bde0345-f819-0410-ac75-e5045f9217cc

src/manager/src/ws_mng_callbacks.c

index 62169dd..b48719c 100644 (file)
@@ -59,15 +59,22 @@ void ws_mng_on_search_word(GError *error,
        /* get the word passed by dbus */
        osso_data = &g_array_index (word, osso_rpc_t, 0);
        gchar* tmp = NULL;
-       if (( g_utf8_strchr(osso_data->value.s, -1, '*') == NULL ) && 
-           ( g_utf8_strchr(osso_data->value.s, -1, '?') == NULL ))
+       
+       if (osso_data->value.s != NULL)
        {
-               tmp = g_strconcat(osso_data->value.s, "*", NULL);
-       }
-       else
-       {
-               tmp = g_strdup(osso_data->value.s);
+       
+               if (( g_utf8_strchr(osso_data->value.s, -1, '*') == NULL ) && 
+               ( g_utf8_strchr(osso_data->value.s, -1, '?') == NULL ))
+               {
+                       tmp = g_strconcat(osso_data->value.s, "*", NULL);
+               }
+               else
+               {
+                       tmp = g_strdup(osso_data->value.s);
+               }
        }
+       
+       else tmp = g_strdup ("*");
 
        /* create and init searching data - separate for each thread */
        WSMngSearchAtom* search_data = NULL;