CpluffAdapter::findPlugins and PluginManagerImpl::findPlugins methods include the
plugins which does not have the attribute of parameter "key" and when the parameter
"value" is empty string. Modified the code to handle the case where getValueByAttribute
method returns empty string value.
Change-Id: Ia2564bff28b273a3552686d16374198e223f0bb2
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1206
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
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]);
}
re_plugins = new std::vector<Plugin>;
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]);
}