From 9747c276644a3a35c8a0dcccea60eef8075afc2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 1 Jul 2025 13:15:09 +0200 Subject: [PATCH] GCC15 fix in ReplayManager.cpp (#24707) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` In member function ‘bool OpenRCT2::ReplayManager::SerialiseCommand(DataSerialiser&, OpenRCT2::ReplayCommand&)’, inlined from ‘bool OpenRCT2::ReplayManager::Serialise(DataSerialiser&, OpenRCT2::ReplayRecordData&)’ at /home/janisozaur/workspace/openrct2/src/openrct2/ReplayManager.cpp:778:37: /home/janisozaur/workspace/openrct2/src/openrct2/ReplayManager.cpp:719:38: error: potential null pointer dereference [-Werror=null-dereference] 719 | command.action->Serialise(serialiser); | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ cc1plus: all warnings being treated as errors ``` ``` $ gcc --version gcc (GCC) 15.1.1 20250425 Copyright (C) 2025 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ``` --- src/openrct2/ReplayManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index 783c838ec6..9ac73ae5b6 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -713,9 +713,9 @@ namespace OpenRCT2 if (serialiser.IsLoading()) { command.action = GameActions::Create(static_cast(actionType)); - Guard::Assert(command.action != nullptr); } + Guard::Assert(command.action != nullptr); command.action->Serialise(serialiser); return true;