Fix:gui_internal:Prevent crash in search dialog when finding streets without name
authorrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 29 Mar 2011 16:57:09 +0000 (16:57 +0000)
committerrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 29 Mar 2011 16:57:09 +0000 (16:57 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4402 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/gui/internal/gui_internal.c

index adf6c83..e8df54d 100644 (file)
@@ -3241,7 +3241,13 @@ gui_internal_search_idle(struct gui_priv *this, char *wm_name, struct widget *se
                        if (! strcmp(wm_name,"Town"))
                                trunk_name = g_strrstr(res->town->common.town_name, wi->text);
                        if (! strcmp(wm_name,"Street"))
-                               trunk_name = g_strrstr(name=res->street->name, wi->text);
+                       {
+                               name=res->street->name;
+                               if (name)
+                                       trunk_name = g_strrstr(name, wi->text);
+                               else
+                                       trunk_name = NULL;
+                       }
 
                        if (trunk_name) {
                                char next_char = trunk_name[strlen(wi->text)];