Commit a9080081 authored by George Nash's avatar George Nash

Fixed build issue for in UpnpGenericService

The code was checking if a std::string==nullptr although
this is an invalid check older compilers seemed to allow
the check. The null check was removed, and when obtaining
the value from the map is checked to make sure its indeed
contains the value in the map.

Change-Id: Ie67527c91d9c138e579179cd791c867bfa15c488
Signed-off-by: George Nash's avatarGeorge Nash <george.nash@intel.com>
parent 26198fc2
......@@ -78,8 +78,11 @@ OCEntityHandlerResult UpnpGenericService::processGetRequest(string uri, OCRepPay
{
const GType type = stateVarInfo->type;
const string gType = g_type_name(type);
argType = GTypeToUpnpTypeMap[gType];
if ((argType == nullptr) || (argType.empty()))
if (GTypeToUpnpTypeMap.end() != GTypeToUpnpTypeMap.find(gType))
{
argType = GTypeToUpnpTypeMap[gType];
}
if (argType.empty())
{
ERROR_PRINT("No type found for GType " << gType);
}
......@@ -183,8 +186,12 @@ OCEntityHandlerResult UpnpGenericService::processGetRequest(string uri, OCRepPay
const GType type = stateVarInfo->type;
const string gType = g_type_name(type);
const string upnpType = GTypeToUpnpTypeMap[gType];
if ((upnpType != nullptr) && (! upnpType.empty()))
string upnpType;
if (GTypeToUpnpTypeMap.end() != GTypeToUpnpTypeMap.find(gType))
{
upnpType = GTypeToUpnpTypeMap[gType];
}
if (!upnpType.empty())
{
if (OCRepPayloadSetPropString(payload, DATA_TYPE.c_str(), upnpType.c_str()))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment