summaryrefslogtreecommitdiff
path: root/protocols/CloudFile/src/Services
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/CloudFile/src/Services')
-rw-r--r--protocols/CloudFile/src/Services/yandex_service.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/protocols/CloudFile/src/Services/yandex_service.cpp b/protocols/CloudFile/src/Services/yandex_service.cpp
index 892821e0c4..e252eed161 100644
--- a/protocols/CloudFile/src/Services/yandex_service.cpp
+++ b/protocols/CloudFile/src/Services/yandex_service.cpp
@@ -102,11 +102,10 @@ void CYandexService::RequestAccessTokenThread(void *param)
NLHR_PTR response(request.Send(m_hConnection));
if (response == nullptr || response->resultCode != HTTP_CODE_OK) {
- const char *error = response->body.GetLength()
- ? response->body
- : HttpStatusToError(response->resultCode);
-
- Netlib_Logf(m_hConnection, "%s: %s", GetAccountName(), error);
+ if (response) {
+ const char *error = response->body.GetLength() ? response->body : HttpStatusToError(response->resultCode);
+ Netlib_Logf(m_hConnection, "%s: %s", GetAccountName(), error);
+ }
ShowNotification(TranslateT("Server does not respond"), MB_ICONERROR);
EndDialog(hwndDlg, 0);
return;