Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battleground: Fix crash when no players are left in a battleground. #574

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mostlikely4r
Copy link
Contributor

🍰 Pullrequest

This is a small crashfix which occurs when a battleground ends up empty.

Proof

The code looks pretty clear m_bg is set to nullptr and the next BattleGroundMap::Update does m_bg->
While I'm unsure if there should have been some mechanic to prevent the update after the m_bg is cleared it clearly does not work.
It's very trivial to reproduce and test though.

How2Test

-Join a battleground (".debug bg" to join alone).
-Hearthstone out and the server crashes.

@killerwife
Copy link
Contributor

In what place in code is it set to nullptr if i may ask. Because this might change with the BG rewrite.

@mostlikely4r
Copy link
Contributor Author

In what place in code is it set to nullptr if i may ask. Because this might change with the BG rewrite.

m_bg = nullptr;

So the first BattleGroundMap::Update sets m_bg to nullptr and the second crashes because it is nullptr.

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