dbusconfiguration: Protect better against bad config

Configurations with no input are not allowed. The
current code looked for if there were any sensors
avaiable. On our systems an input was not being
displayed due to a bug, but the output was there,
causing pid control to crash. Protect against this
issue.

Tested: Had sensor bug in tree, and pid control didn't
segfault

Change-Id: I42869748bac0b85affae5f5c671b859fec996a54
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp
index 1fd0d1a..c33264c 100644
--- a/dbus/dbusconfiguration.cpp
+++ b/dbus/dbusconfiguration.cpp
@@ -507,12 +507,6 @@
                     findSensors(sensors, name, sensorInterfaces);
                 }
 
-                // if the sensors aren't available in the current state, don't
-                // add them to the configuration.
-                if (sensorInterfaces.empty())
-                {
-                    continue;
-                }
                 for (const auto& sensorPathIfacePair : sensorInterfaces)
                 {
 
@@ -562,6 +556,13 @@
                     }
                 }
 
+                // if the sensors aren't available in the current state, don't
+                // add them to the configuration.
+                if (inputs.empty())
+                {
+                    continue;
+                }
+
                 struct conf::ControllerInfo& info =
                     conf[std::get<std::string>(base.at("Name"))];
                 info.inputs = std::move(inputs);