Fix null pointer exception on motd fetch failure (#1071)

This commit is contained in:
in1tiate 2025-01-23 03:16:56 -06:00 committed by GitHub
parent fa94955d4f
commit d333934f9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -553,7 +553,10 @@ void Lobby::get_motd()
{
document = tr("Couldn't get the message of the day.");
}
ui_motd_text->setHtml(document);
if (ui_motd_text)
{
ui_motd_text->setHtml(document);
}
});
}

View File

@ -82,7 +82,7 @@ private:
QPushButton *ui_refresh_button;
// Serverinfo / MOTD Horizontal Row
QTextBrowser *ui_motd_text;
QPointer<QTextBrowser> ui_motd_text;
QLabel *ui_server_player_count_lbl;
QTextBrowser *ui_server_description_text;