ID:2804205
 
Server Error log:
Fri Jul 15 00:59:46 2022
runtime error: Cannot read null.monst_crit
proc name: objphydamage (/mob/proc/objphydamage)
usr: (src)
src: Moo (/mob/soldier)
src.loc: (162,180,7) (/turf/battleturfs/battletree)
call stack:
Moo (/mob/soldier): objphydamage(null, Moo (/mob/soldier), 1, null, 1, 1)
Moo (/mob/soldier): npcattack(null, Moo (/mob/soldier), null)
Moo (/mob/soldier): npcdeathcheck(null, Moo (/mob/soldier), null)
Moo (/mob/soldier): pcattack(null, Moo (/mob/soldier), null, null)
Moo (/mob/soldier): maincombat(Moo (/mob/soldier), null)
Moo (/mob/soldier): playerdeathcheck(null, Moo (/mob/soldier), null)
Moo (/mob/soldier): npcattack(null, Moo (/mob/soldier), null)
Moo (/mob/soldier): npcdeathcheck(null, Moo (/mob/soldier), null)
Moo (/mob/soldier): pcattack(null, Moo (/mob/soldier), null, null)
Moo (/mob/soldier): maincombat(Moo (/mob/soldier), null)
Moo (/mob/soldier): forceencounter("Troll", Moo (/mob/soldier))
Moo (/mob/soldier): randomencounter1(15, Moo (/mob/soldier), 0, null)
(162,180,7) (/turf/battleturfs/battletree): Entered(Moo (/mob/soldier), (161,180,7) (/turf/battleturfs/battletree))

BUG: Bad ref (2:832) in DecRefCount(DM Del)
Fri Jul 15 04:44:44 2022
runtime error: Cannot read null.monst_def
proc name: pcattack (/mob/proc/pcattack)
usr: (src)
src: Moo (/mob/soldier)
src.loc: (157,87,7) (/turf/battleturfs/battletree)
call stack:
Moo (/mob/soldier): pcattack("Spell/Skill", Moo (/mob/soldier), null, null)
Moo (/mob/soldier): maincombat(Moo (/mob/soldier), null)
Moo (/mob/soldier): forceencounter("Dragon", Moo (/mob/soldier))
Moo (/mob/soldier): randomencounter1(15, Moo (/mob/soldier), 0, null)
(157,87,7) (/turf/battleturfs/battletree): Entered(Moo (/mob/soldier), (158,87,7) (/turf/battleturfs/battletree))


Problem description:

Sometimes it seems that enemy mobs created in my game randomly get nulled out. Is there any way to troubleshoot a bug like this or is it a problem from having a large code base?
Gonna try adding some if statements to make sure the mobs aren't null to these functions and see what happens
It would help to see the code and the lines where the nulling happens.

The bad ref error is concerning, as it indicates a situation that should never happen. Short of a BYOND bug, it might indicate that Del() has been overridden somewhere without calling ..().
In response to Lummox JR
I'm not really sure where in the code exactly this is erroring ...none of these procs are doing any nulling. Which one do you need to take a look at? All of them?
I think checking to make sure my mobs weren't null fixed the bug I was having. Will have to do more testing when I wake up.