Skip to content

Commit

Permalink
Update GSM time function.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Aug 12, 2023
1 parent fb4f88a commit 7696ae6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ESP_Mail_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ bool ESP_Mail_Client::prepareTime(Session_Config *session_config, void *sessionP
#if defined(ENABLE_SMTP)
SMTPSession *smtp = (SMTPSession *)sessionPtr;
client_type = smtp->client.type();
client = smtp->client;
client = &smtp->client;
isCb = isResponseCB((void *)smtp->_customCmdResCallback, isSMTP);
#if defined(ENABLE_NTP_TIME) && !defined(SILENT_MODE)
debug = smtp->_debug;
Expand All @@ -1370,7 +1370,7 @@ bool ESP_Mail_Client::prepareTime(Session_Config *session_config, void *sessionP
#if defined(ENABLE_IMAP)
IMAPSession *imap = (IMAPSession *)sessionPtr;
client_type = imap->client.type();
client = imap->client;
client = &imap->client;
isCb = isResponseCB((void *)imap->_customCmdResCallback, isSMTP);
#if defined(ENABLE_NTP_TIME) && !defined(SILENT_MODE)
debug = imap->_debug;
Expand All @@ -1382,7 +1382,7 @@ bool ESP_Mail_Client::prepareTime(Session_Config *session_config, void *sessionP
{
if (!Time.clockReady())
{
if (client_type == esp_mail_client_type_external_gsm_client)
if (client && client_type == esp_mail_client_type_external_gsm_client)
{
uint32_t _time = client->gprsGetTime();
if (_time > 0)
Expand Down

0 comments on commit 7696ae6

Please sign in to comment.