diff options
| author | in1tiate <32779090+in1tiate@users.noreply.github.com> | 2025-01-23 03:16:56 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-23 03:16:56 -0600 |
| commit | d333934f9bc1668bdab89cd44ba7807eaa37b172 (patch) | |
| tree | 324e4160930362a0dbafd1c88869db73068c0fbb | |
| parent | fa94955d4f76735aac621d74b7f28a905a898998 (diff) | |
Fix null pointer exception on motd fetch failure (#1071)
| -rw-r--r-- | src/lobby.cpp | 5 | ||||
| -rw-r--r-- | src/lobby.h | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/lobby.cpp b/src/lobby.cpp index 5e98b757..d4a58e9e 100644 --- a/src/lobby.cpp +++ b/src/lobby.cpp @@ -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); + } }); } diff --git a/src/lobby.h b/src/lobby.h index 8b894f4c..0221b5f5 100644 --- a/src/lobby.h +++ b/src/lobby.h @@ -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; |
