summaryrefslogtreecommitdiff
path: root/navit/gui
diff options
context:
space:
mode:
authorsleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2014-09-10 22:35:43 +0000
committersleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2014-09-10 22:35:43 +0000
commitc72999bb06160b3fc51877e221657715529e849c (patch)
tree60a4543afa22083b8a4e6824461aaa9dfe9453b4 /navit/gui
parent017877fc8eda7b3685ab43dfa519d6f8050ac529 (diff)
downloadnavit-c72999bb06160b3fc51877e221657715529e849c.tar.gz
Fix:gui/internal:Log an error for search results without a name (which should never happen).
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5891 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/gui')
-rw-r--r--navit/gui/internal/gui_internal_search.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/navit/gui/internal/gui_internal_search.c b/navit/gui/internal/gui_internal_search.c
index 6e92382a7..136f1ad93 100644
--- a/navit/gui/internal/gui_internal_search.c
+++ b/navit/gui/internal/gui_internal_search.c
@@ -335,25 +335,26 @@ gui_internal_search_idle(struct gui_priv *this, char *wm_name, struct widget *se
item_name=res->country->name;
item=&res->country->common.item;
result_main_label=g_strdup_printf("%s", res->country->name);
- }
- if (! strcmp(wm_name,"Town")) {
+ } else if (! strcmp(wm_name,"Town")) {
item=&res->town->common.item;
item_name=res->town->common.town_name;
result_main_label=town_display_label(res, 1, 0);
result_sublabel=town_display_label(res, 1, 2);
- }
- if (! strcmp(wm_name,"Street")) {
+ } else if (! strcmp(wm_name,"Street")) {
item_name=res->street->name;
item=&res->street->common.item;
result_main_label=g_strdup(res->street->name);
result_sublabel=town_display_label(res, 2, 1);
- }
- if (! strcmp(wm_name,"House number")) {
+ } else if (! strcmp(wm_name,"House number")) {
item_name=res->house_number->house_number;
result_main_label=g_strdup_printf("%s, %s", item_name, res->street->name);
result_sublabel=town_display_label(res, 3, 0);
widget_name=g_strdup(result_main_label);
}
+ if(!item_name) {
+ dbg(0, "Skipping nameless item in search (search type: %s). Please report this as a bug.\n", wm_name);
+ return;
+ }
if(!widget_name)
widget_name=g_strdup(item_name);