The function FOnlineSessionNull::CancelFindSessions() has a bug.
bool FOnlineSessionNull::CancelFindSessions()
{
uint32 Return = E_FAIL;
if (CurrentSessionSearch->SearchState == EOnlineAsyncTaskState::InProgress)
{
// Make sure it's the right type
Return = ERROR_SUCCESS;
FinalizeLANSearch();
CurrentSessionSearch->SearchState = EOnlineAsyncTaskState::Failed;
CurrentSessionSearch = NULL;
}
else
{
UE_LOG_ONLINE(Warning, TEXT("Can't cancel a search that isn't in progress"));
}
if (Return != ERROR_IO_PENDING)
{
TriggerOnCancelFindSessionsCompleteDelegates(true);
}
return Return == ERROR_SUCCESS || Return == ERROR_IO_PENDING;
}
The CurrentSessionSearch is invalid. The code should test as :
if (CurrentSessionSearch.IsValid() && CurrentSessionSearch->SearchState == EOnlineAsyncTaskState::InProgress)
Otherwise if the function is called without having a search, an exception is thrown.
D.