diff --git a/megamek/src/megamek/common/actions/WeaponAttackAction.java b/megamek/src/megamek/common/actions/WeaponAttackAction.java index 3d5899c139c..1d682b64782 100644 --- a/megamek/src/megamek/common/actions/WeaponAttackAction.java +++ b/megamek/src/megamek/common/actions/WeaponAttackAction.java @@ -5173,7 +5173,8 @@ public static ToHitData processAttackerSPAs(ToHitData toHit, Entity ae, Targetab // blood stalker SPA if (ae.getBloodStalkerTarget() > Entity.NONE) { - if (ae.getBloodStalkerTarget() == target.getId()) { + // Issue #5275 - Attacker with bloodstalker SPA, `target` can be null if a building etc. + if ((target != null) && (ae.getBloodStalkerTarget() == target.getId())) { toHit.addModifier(-1, Messages.getString("WeaponAttackAction.BloodStalkerTarget")); } else { toHit.addModifier(+2, Messages.getString("WeaponAttackAction.BloodStalkerNonTarget"));