Ama
New Member
- Joined
- Jun 6, 2011
- Messages
- 1,171
- Reaction score
- 33
I have a null get a null reference exception occasionally when checking to see if my tank is null. I don't understand why I get the exception b/c I am making the check in an attempt to avoid an exception. It doesn't appear to have any impact on performance, but I would like to eradicate errors from my logs. The line that causes the error is "tank!=null" Here is the code and error:
[10:01:27 PM:189] System.NullReferenceException: Object reference not set to an instance of an object.
at HolyPaladinCC.HolyPaladinCC.Self() in Path\HolyPaladinCC.cs:line 227
at HolyPaladinCC.HolyPaladinCC.Combat() in Path\HolyPaladinCC.cs:line 119
at HolyPaladinCC.HolyPaladinCC.Pulse() in Path\HolyPaladinCC.cs:line 60
at Styx.WoWPulsator.Pulse(PulseFlags flags)
at Styx.Logic.BehaviorTree.TreeRoot.Tick()
at Styx.Logic.BehaviorTree.TreeRoot.Run()
PHP:
if (tank != null
&& tank.Distance < 60
&& tank.Combat
&& !tank.HasAura("Beacon of Light")
&& CC("Beacon of Light", tank))
{
C("Beacon of Light", tank);
}
[10:01:27 PM:189] System.NullReferenceException: Object reference not set to an instance of an object.
at HolyPaladinCC.HolyPaladinCC.Self() in Path\HolyPaladinCC.cs:line 227
at HolyPaladinCC.HolyPaladinCC.Combat() in Path\HolyPaladinCC.cs:line 119
at HolyPaladinCC.HolyPaladinCC.Pulse() in Path\HolyPaladinCC.cs:line 60
at Styx.WoWPulsator.Pulse(PulseFlags flags)
at Styx.Logic.BehaviorTree.TreeRoot.Tick()
at Styx.Logic.BehaviorTree.TreeRoot.Run()






