From f431c14ab74445174a731e9f2bedb6ba83624415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Tue, 30 Jun 2015 22:36:52 +0200 Subject: [PATCH] fix possible NREs --- OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs b/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs index 01acee6593..bfd1d151b5 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs @@ -77,6 +77,9 @@ namespace OpenRA.Mods.Common.Traits public void Attacking(Actor self, Target target, Armament a, Barrel barrel) { + if (a == null) + return; + var sequence = a.Info.MuzzleSequence; if (sequence == null) return; @@ -84,6 +87,9 @@ namespace OpenRA.Mods.Common.Traits if (a.Info.MuzzleSplitFacings > 0) sequence += OpenRA.Traits.Util.QuantizeFacing(getFacing(), a.Info.MuzzleSplitFacings).ToString(); + if (barrel == null) + return; + visible[barrel] = true; anims[barrel].Animation.PlayThen(sequence, () => visible[barrel] = false); }