Skip to content

Fix nullptr crash when moving camera after loading game#753

Open
jhasse wants to merge 1 commit intoWargus:masterfrom
jhasse:fix-crash-after-savegame-load
Open

Fix nullptr crash when moving camera after loading game#753
jhasse wants to merge 1 commit intoWargus:masterfrom
jhasse:fix-crash-after-savegame-load

Conversation

@jhasse
Copy link
Copy Markdown

@jhasse jhasse commented Aug 21, 2025

Hi there :)

I'm new to Stratagus and just found out about it via Wargus. First of all awesome work, thank you very much!

I was playing the W2 campaign and after loading a savegame I moved the camera to my base which lead to a crash. I noticed that this is reproducible so I run with GDB attached and looked at the backtrace: type->Construction is nullptr. Adding this check fixes the crash and I can continue playing just fine. I have no idea what this code does though :D

I can provide you with the savegame if you want.

@Jarod42
Copy link
Copy Markdown
Member

Jarod42 commented Aug 21, 2025

I have no idea what this code does though :D
That is the part of the code which draw unit under fog of war.

Whereas it might fix the crash, I wonder if there are previous issue: Not sure if type->Construction might be nullptr or not.

I can provide you with the savegame if you want.

Repro would be fine indeed.

@jhasse
Copy link
Copy Markdown
Author

jhasse commented Aug 25, 2025

Here's the save game: crash.sav.gz

After loading move the camera to the bottom right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants