diff --git a/StateObserver/StateObserver.cpp b/StateObserver/StateObserver.cpp index 1bb6e86896..bdc38c09d4 100644 --- a/StateObserver/StateObserver.cpp +++ b/StateObserver/StateObserver.cpp @@ -306,10 +306,12 @@ namespace WPEFramework { checkForStandalone = false; } IARM_Bus_SYSMgr_GetSystemStates_Param_t param; - IARM_Bus_Call(IARM_BUS_SYSMGR_NAME, IARM_BUS_SYSMGR_API_GetSystemStates, ¶m, sizeof(param)); + IARM_Result_t res = IARM_Bus_Call(IARM_BUS_SYSMGR_NAME, IARM_BUS_SYSMGR_API_GetSystemStates, ¶m, sizeof(param)); JsonArray response_arr; - for( std::vector::iterator it = pname.begin(); it!= pname.end(); ++it ) + if(res == IARM_RESULT_SUCCESS) { + for( std::vector::iterator it = pname.begin(); it!= pname.end(); ++it ) + { string err_str="none"; JsonObject devProp; if(*it == SYSTEM_CHANNEL_MAP) @@ -589,6 +591,7 @@ namespace WPEFramework { } } + } response["properties"]=response_arr; #if(DEBUG_INFO) diff --git a/SystemServices/SystemServices.cpp b/SystemServices/SystemServices.cpp index 2f7a5a9848..db096f19be 100644 --- a/SystemServices/SystemServices.cpp +++ b/SystemServices/SystemServices.cpp @@ -1815,16 +1815,17 @@ namespace WPEFramework { LOGINFO("Got cached NetworkStandbyMode: '%s'", m_networkStandbyMode ? "true" : "false"); } else { - IARM_Bus_PWRMgr_NetworkStandbyMode_Param_t param; + IARM_Bus_PWRMgr_NetworkStandbyMode_Param_t param = {}; IARM_Result_t res = IARM_Bus_Call(IARM_BUS_PWRMGR_NAME, IARM_BUS_PWRMGR_API_GetNetworkStandbyMode, (void *)¶m, sizeof(param)); - bool nwStandby = param.bStandbyMode; - - LOGWARN("getNetworkStandbyMode called, current NwStandbyMode is: %s\n", - nwStandby?("Enabled"):("Disabled")); - response["nwStandby"] = nwStandby; + if (IARM_RESULT_SUCCESS == res) { + bool nwStandby = param.bStandbyMode; + + LOGWARN("getNetworkStandbyMode called, current NwStandbyMode is: %s\n", + nwStandby?("Enabled"):("Disabled")); + response["nwStandby"] = nwStandby; retVal = true; m_networkStandbyMode = nwStandby; m_networkStandbyModeValid = true;