diff --git a/src/client/cpp/GraphClient.cpp b/src/client/cpp/GraphClient.cpp index 4cbac161470..32ffa9bab0a 100644 --- a/src/client/cpp/GraphClient.cpp +++ b/src/client/cpp/GraphClient.cpp @@ -47,7 +47,7 @@ cpp2::ErrorCode GraphClient::connect(const std::string& username, client_->sync_authenticate(resp, username, password); if (resp.get_error_code() != cpp2::ErrorCode::SUCCEEDED) { LOG(ERROR) << "Failed to authenticate \"" << username << "\": " - << resp.get_error_msg(); + << ((!resp.get_error_msg()) ? *(resp.get_error_msg()) : ""); return resp.get_error_code(); } } catch (const std::exception& ex) {