Add check for the selected_service before calling GetProperties
am: e477f1e5fd

* commit 'e477f1e5fd82dfcb545b9f57b98b0d3384ac75de':
  Add check for the selected_service before calling GetProperties

Change-Id: I0272c6907d5e66a990021c18322d0b0f7f98d08d
diff --git a/buffet/shill_client.cc b/buffet/shill_client.cc
index 8e6e1e9..afaebba 100644
--- a/buffet/shill_client.cc
+++ b/buffet/shill_client.cc
@@ -219,8 +219,10 @@
 std::string ShillClient::GetConnectedSsid() const {
   for (const auto& kv : devices_) {
     VariantDictionary properties;
-    if (!kv.second.selected_service->GetProperties(&properties, nullptr))
+    if (kv.second.selected_service &&
+        (!kv.second.selected_service->GetProperties(&properties, nullptr))) {
       continue;
+    }
 
     auto property_it = properties.find(shill::kWifiHexSsid);
     if (property_it == properties.end()) continue;