Fix preferences dialog.
[dhcpcd-ui] / src / dhcpcd-qt / dhcpcd-ssidmenu.cpp
index ed8f510a199e1ff9fc7af046aea7b3f76e442001..dc0795b9f98227d4d02fb2c3c93350377f430d0a 100644 (file)
@@ -57,6 +57,7 @@ DhcpcdSsidMenu::DhcpcdSsidMenu(QWidget *parent, QWidgetAction *wa,
        setScan(scan);
 
        this->installEventFilter(this);
+       button->installEventFilter(this);
 }
 
 QWidgetAction *DhcpcdSsidMenu::getWidgetAction()
@@ -81,7 +82,8 @@ void DhcpcdSsidMenu::setScan(DHCPCD_WI_SCAN *scan)
        wpa = wi->getWpa();
        i = dhcpcd_wpa_if(wpa);
 
-       button->setChecked(i->up && strcmp(scan->ssid, i->ssid) == 0);
+       button->setChecked(i->up && i->ssid &&
+           strcmp(scan->ssid, i->ssid) == 0);
        button->setText(scan->ssid);
        if (scan->flags[0] == '\0') {
                icon = DhcpcdQt::getIcon("devices", "network-wireless");