From 0335bb502bfa53b1ad47130e07bf202030b76958 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Sat, 25 Mar 2023 01:00:24 +0100 Subject: [PATCH] preemptively avoid a crash --- src/frontend/qt_sdl/Netplay.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/frontend/qt_sdl/Netplay.cpp b/src/frontend/qt_sdl/Netplay.cpp index 19444940..2aa524cf 100644 --- a/src/frontend/qt_sdl/Netplay.cpp +++ b/src/frontend/qt_sdl/Netplay.cpp @@ -466,6 +466,8 @@ void StartGame() void ProcessHost() { + if (!Host) return; + ENetEvent event; while (enet_host_service(Host, &event, 0) > 0) { @@ -553,6 +555,8 @@ void ProcessHost() void ProcessClient() { + if (!Host) return; + ENetEvent event; while (enet_host_service(Host, &event, 0) > 0) { @@ -644,6 +648,8 @@ printf("birf\n"); void ProcessMirrorHost() { + if (!MirrorHost) return; + ENetEvent event; while (enet_host_service(MirrorHost, &event, 0) > 0) { @@ -669,6 +675,8 @@ void ProcessMirrorHost() void ProcessMirrorClient() { + if (!MirrorHost) return; + ENetEvent event; while (enet_host_service(MirrorHost, &event, 0) > 0) {