Fix for the Jira issue IOT-538
[platform/upstream/iotivity.git] / service / protocol-plugin / plugin-manager / src / CpluffAdapter.cpp
index 8db6d6e..b4b641f 100644 (file)
@@ -313,7 +313,8 @@ std::vector<Plugin> *CpluffAdapter::findPlugins(const std::string key, const std
 
     for (unsigned int i = 0; i < m_plugins.size(); i++)
     {
-        if (!m_plugins[i].getValueByAttribute(key).compare(value))
+        std::string attributeValue = m_plugins[i].getValueByAttribute(key);
+        if (!attributeValue.empty() && !attributeValue.compare(value))
         {
             re_plugins->push_back(m_plugins[i]);
         }