[1.0] GenRecipe.PostProcessProduct leads to nullReference Exception

Started by Albion, January 26, 2019, 05:06:42 AM

Previous topic - Next topic

Albion

Hi,
about 3 months ago I reported a bug in the core code here.
It was deemed resolved 3 weeks later.
To be honest I never checked for it but today I removed my own hotfix for the issue and was surprised to learn that the bug is still present and going strong.
Here is my original text which still describes the bug:

I created a recipe to craft Doomsday and triple rocket launchers for my mod.
However I ran into the following problem:
The vanilla defs for these launchers inherit from the BaseGun def which includes the art comp but NOT the quality comp. However when the recipe is finished the Method PostProcessProduct in the class GenRecipe gets called. The method checks first if the compQuality is null (which it is) and then checks for the compArt (which is NOT null) in the following process it however calls the compQuality without checking again if it is still null!
This leads to a nullRef exception because the launchers have a compArt but NOT a compQuality.

Therefore either the method has to be adjusted to check again for the compQuality or the entire subroutine for compArt should be moved into the routine for compQuality.
Alternatively the BaseGun def should have it's compArt moved to the BaseGunWithQuality def.