Skip to content
This repository was archived by the owner on Jul 22, 2022. It is now read-only.

Commit 46c321f

Browse files
committed
issue #22
1 parent 648e89e commit 46c321f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/httpapi.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ HTTPSClient* httpsClient = NULL;
1515

1616
HTTPAPI_RESULT HTTPAPI_Init(void)
1717
{
18-
httpsClient = new HTTPSClient(AzureIoTHubClient::sslClient);
19-
httpsClient->setTimeout(10000);
20-
21-
return HTTPAPI_OK;
18+
if(AzureIoTHubClient::sslClient != NULL)
19+
{
20+
httpsClient = new HTTPSClient(AzureIoTHubClient::sslClient);
21+
httpsClient->setTimeout(10000);
22+
return HTTPAPI_OK;
23+
}
24+
LogError("HTTPAPI_Init failed. AzureIoTHubClient::sslClient is NULL\n");
25+
return HTTPAPI_INIT_FAILED;
2226
}
2327

2428
void HTTPAPI_Deinit(void)

0 commit comments

Comments
 (0)