Merge pull request #8211 from spycrab/netplay_index_empty_error

Core/NetPlayServer: Fix empty error messages when adding session
This commit is contained in:
spycrab 2019-06-22 06:30:58 +02:00 committed by GitHub
commit 981925a831
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -206,7 +206,10 @@ void NetPlayServer::SetupIndex()
session.EncryptID(Config::Get(Config::NETPLAY_INDEX_PASSWORD)); session.EncryptID(Config::Get(Config::NETPLAY_INDEX_PASSWORD));
if (m_dialog != nullptr) if (m_dialog != nullptr)
m_dialog->OnIndexAdded(m_index.Add(session), m_index.GetLastError()); {
bool success = m_index.Add(session);
m_dialog->OnIndexAdded(success, success ? "" : m_index.GetLastError());
}
m_index.SetErrorCallback([this] { m_index.SetErrorCallback([this] {
if (m_dialog != nullptr) if (m_dialog != nullptr)