Add check for the selected_service before calling GetProperties am: e477f1e5fd
am: 9f450c918a

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

Change-Id: I86191a1bd659df5ac03b787ae42e9e340c087c75
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;