if(!src)
return
But slowly I've seen the number of that snippet grow to fairly ridiculous amounts, especially when a decision is made involving multiple entities. if(!this), if(!that), if(!everything). The next step I thought about was to encase everything in try/catch blocks, though I have very many individual objects and turfs that contain these checks, and adding all of these try/catch blocks seems like it'd be a lot of extra indentation and still extra code. Then, I thought about modifying world/Error() to deal with this, and thought I'd check in here before doing anything too drastic.
I can live with NPC mobs or objects finding weird ways to obliterate in the middle of being useful. That can be fixed. My main issue is with players leaving while doing things, immediately chucking null references and fracturing things. Truth be told, often times this is just me trying to keep the error log clean of players logging out mid-conversation of an NPC or something of the like. Is it advisable to use world/Error() to catch and promptly ignore null references thrown by players, or is this taboo too unsafe to be broken for convenience purposes? Alternatively, what methods have you all used and seen for dealing with players leaving while doing things? Try/catch, conditional checks, etc?
There are a lot of cases when you want a runtime error to happen though, then you'd fix the underlying cause of that reference being null. The cases you mentioned aren't really in that category, but it's a good idea to keep track of which ones are going to be gracefully handled by simply checking if the reference is valid and the ones that should never be executed with those problems in the first place.
For example, if you have MyProc() crashing with a null reference, you shouldn't have an if(!reference) in MyProc(), you should be finding places where said reference can be null when calling MyProc(), those are the places you'd handle things because that's where you'd want to figure out why that reference isn't what it should be.