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

FIX: NPE when attacking a unit on a building when Blood Stalking another unit. #5354

Merged
merged 1 commit into from
Apr 13, 2024

Conversation

HoneySkull
Copy link
Collaborator

This fixes #5275

When targeting a mech on a building, a choice dialog is created that calculates some to-hit metrics for each of the targets in the selected hex for the user to choose. However, when the attacker has the Blood Stalker SPA with a declared target, this ends up trying to compare the building to see if it's the chosen target in which case the target value passed to the to-hit calculation logic is passed as null.

This fix checks to see if target is null before calling target.getID().

@HoneySkull HoneySkull merged commit 4da0bca into MegaMek:master Apr 13, 2024
4 checks passed
@HoneySkull HoneySkull deleted the NPE_Issue_5275 branch April 13, 2024 20:27
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.

[49.19-SNAPSHOT #1439] NPE When Targeting Unit Atop Building
2 participants