LoginAsync will return an FBResult instead of a nullptr

This commit is contained in:
Austin Diviness 2016-01-22 14:18:52 -08:00
Родитель 1197fb4e8d
Коммит 03efdf31a5
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -235,7 +235,7 @@ void MainPage::login_OnClicked(
TryRerequest(FALSE);
}));
}
else if (result != nullptr && result->Succeeded)
else if (result->Succeeded)
{
// Got a token and all our permissions.
NavigateToOptionsPage();

Просмотреть файл

@ -1085,6 +1085,13 @@ IAsyncOperation<FBResult^>^ FBSession::LoginAsync(
_loggedIn = false;
AccessTokenData = nullptr;
}
if (finalResult == nullptr)
{
finalResult = ref new FBResult(ref new FBError(0, L"Unexpected error", L"Log in attempt failed"));
#ifdef DEBUG
OutputDebugString(L"LoginAsync was about to return nullptr, created FBResult object to return instead");
#endif
}
return finalResult;
});