-
Notifications
You must be signed in to change notification settings - Fork 328
Description
Specifications
Please provide the following.
Rimworld version: 1.6.4.630
Combat Extended version: 16.7.2.0
Combat Extended source (Steam, GitHub, etc.): Steam
Your operating system: Win11
Your mod list: 450+
Description
In heavily modded game, very rarely a null reference exception occurs in Verb_MeleeAttackCE.DoParry. I have seen this twice in testing my modlist for a few days. Unable to provide a clean log from a minimal mod list because I don't know how to reproduce the problem. This also makes it possible that this is caused by some mod interaction on my side.
However, I think the culprit is likely this line of code in the DoParry method:
(Line 766) if (!parryThing.Stuff.stuffProps.soundMeleeHitBlunt.NullOrUndefined())
If Stuff or stuffProps is null here, the call to NullOrUndefined will fail with a NullReferenceException. I think a safer way to write this would be something like this:
var sound = parryThing?.Stuff?.stuffProps?.soundMeleeHitBlunt;
if (sound != null && !sound.NullOrUndefined())
Expected behavior
No NullReferenceException
To reproduce
Unable to provide steps.
Screenshots & log dumps
(https://pastebin.com/Yze5v9cr)
Complete the following checklist
I hereby verify that I have done the following:
- [ x] Confirmed that my game version and load order are correct.
- [ x] Confirmed that I am running the appropriate and most updated version of Combat Extended and required compatibility patches.
- [ x] Confirmed I am not running any mods with known incompatibilities with Combat Extended.
- [ ?] Disabled Combat Extended and attempted to reproduce the behavior without success.