From 119ac66c5c70da2cff0cb434597755aa1a5dd78f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Sat, 8 Jul 2023 16:54:39 +0200 Subject: [PATCH] Fix: [Bootstrap] don't crash when failing to connect to content server (#11122) --- src/bootstrap_gui.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bootstrap_gui.cpp b/src/bootstrap_gui.cpp index b77e72049b..57d7e96fd2 100644 --- a/src/bootstrap_gui.cpp +++ b/src/bootstrap_gui.cpp @@ -263,6 +263,14 @@ public: void OnConnect(bool success) override { + if (!success) { + UserError("Failed to connect to content server. Please acquire a graphics set for OpenTTD. See section 1.4 of README.md."); + /* _exit_game is used to break out of the outer video driver's MainLoop. */ + _exit_game = true; + this->Close(); + return; + } + /* Once connected, request the metadata. */ _network_content_client.RequestContentList(CONTENT_TYPE_BASE_GRAPHICS); }