When the configuration is not initialized, for example because the
demon does not use the configuration, this program will run into a
segmentation fault when a new resource gets registered.
Change-Id: I1a6b4b468bdc74136e91ffb5c5dbc3c4d276fe15
Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/4151
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Markus Jung <markus.jung85@gmail.com>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
std::string(strUri + ", " +
strResourceType).c_str());
- if (m_config->isHasInput(resource->m_bundleId))
+ if (m_config && m_config->isHasInput(resource->m_bundleId))
{
discoverInputResource(strUri);
}
std::string(resource->m_uri + ", " +
resource->m_resourceType).c_str());
- if (m_config->isHasInput(resource->m_bundleId))
+ if (m_config && m_config->isHasInput(resource->m_bundleId))
{
undiscoverInputResource(strUri);
}