1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 17:42:29 +01:00

GCC15 fix in ReplayManager.cpp (#24707)

```
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.
```
This commit is contained in:
Michał Janiszewski
2025-07-01 13:15:09 +02:00
committed by GitHub
parent 1826c8bcd2
commit 9747c27664

View File

@@ -713,9 +713,9 @@ namespace OpenRCT2
if (serialiser.IsLoading()) if (serialiser.IsLoading())
{ {
command.action = GameActions::Create(static_cast<GameCommand>(actionType)); command.action = GameActions::Create(static_cast<GameCommand>(actionType));
Guard::Assert(command.action != nullptr);
} }
Guard::Assert(command.action != nullptr);
command.action->Serialise(serialiser); command.action->Serialise(serialiser);
return true; return true;