[gnome-internet-radio-locator] Add if-test in the case of NULL in the reverse map lookup



commit d2fc71cef8e32eaf3d0309e023aa7bf40735fae9
Author: Ole Aamot <oka oka no>
Date:   Sat Sep 16 16:55:39 2017 +0200

    Add if-test in the case of NULL in the reverse map lookup

 src/gnome-internet-radio-locator.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/gnome-internet-radio-locator.c b/src/gnome-internet-radio-locator.c
index 52f4bfa..7bb39b8 100644
--- a/src/gnome-internet-radio-locator.c
+++ b/src/gnome-internet-radio-locator.c
@@ -131,9 +131,11 @@ mouse_click_cb (ClutterActor *actor, ClutterButtonEvent *event, ChamplainView *v
        marker = champlain_label_new_from_file ("icons/emblem-generic.png", NULL);
        champlain_label_set_text (CHAMPLAIN_LABEL (marker), (gchar *)name);
        champlain_location_set_location (CHAMPLAIN_LOCATION (marker), lat, lon);
-       champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
-       gtk_entry_set_text(GTK_ENTRY(input),(gchar *)name);
-       g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), NULL);
+       if (g_strcmp0(name, NULL)) {
+               champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
+               gtk_entry_set_text(GTK_ENTRY(input),(gchar *)name);
+               g_signal_connect(CHAMPLAIN_LOCATION(marker), "button-press", G_CALLBACK(marker_function), 
NULL);
+       }
        GNOME_INTERNET_RADIO_LOCATOR_DEBUG_MSG("Mouse click at: %f %f (%s)\n", lat, lon, name);
        return TRUE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]