* @param[in] request The download request
* @param[out] reqId The request ID
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG The URL of the download request is invalid.
+ * @exception E_INVALID_ARG The information of the download request is invalid.
* @exception E_ILLEGAL_ACCESS Access to the path of the download request is denied due to insufficient permission.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
//Add http headers
IMap* pRequestHeader = _DownloadRequestImpl::GetInstance(&request)->GetRequestHeader();
std::unique_ptr<IMapEnumerator> pMapEnume(const_cast< IMap* >(pRequestHeader)->GetMapEnumeratorN());
- while (pMapEnume->MoveNext() == E_SUCCESS)
- {
- String* pMapKey = dynamic_cast<String*>(pMapEnume->GetKey());
- unique_ptr<char[]> pKey(_StringConverter::CopyToCharArrayN(*pMapKey));
- String* pMapValue = dynamic_cast<String*>(pMapEnume->GetValue());
- unique_ptr<char[]> pValue(_StringConverter::CopyToCharArrayN(*pMapValue));
+ while (pMapEnume->MoveNext() == E_SUCCESS)
+ {
+ String* pMapKey = dynamic_cast<String*>(pMapEnume->GetKey());
+ String* pMapValue = dynamic_cast<String*>(pMapEnume->GetValue());
+ if (pMapKey && pMapValue)
+ {
+ unique_ptr<char[]> pKey(_StringConverter::CopyToCharArrayN(*pMapKey));
+ unique_ptr<char[]> pValue(_StringConverter::CopyToCharArrayN(*pMapValue));
- ret = download_add_http_header_field(download_id, pKey.get(), pValue.get());
- SysTryReturnResult(NID_CNT, ret >= 0, E_SYSTEM, "The internal system service is not available. %d", ret);
- }
+ ret = download_add_http_header_field(download_id, pKey.get(), pValue.get());
+ SysTryReturnResult(NID_CNT, ret >= 0, E_SYSTEM, "The internal system service is not available. %d", ret);
+
+ }
+ }
// Check the download path
if (!dirPath.IsEmpty())