NullReferenceException in RemoveFromPQSCities
k-dueb opened this issue ยท 4 comments
Hi!
- KSP 1.7.3
- EVE 1.4.2-2
NullReferenceException in RemoveFromPQSCities:
System.NullReferenceException: Object reference not set to an instance of an object
at Utils.MaterialPQS.RemoveFromPQSCities () [0x00000] in <filename unknown>:0
at Utils.MaterialPQS.Remove () [0x00000] in <filename unknown>:0
at CelestialShadows.ShadowObject.Remove () [0x00000] in <filename unknown>:0
at EVEManager.GenericEVEManager`1[T].Clean () [0x00000] in <filename unknown>:0
at EVEManager.EVEManagerBase.Apply () [0x00000] in <filename unknown>:0
at EVEManager.EVEManagerBase.LoadConfig () [0x00000] in <filename unknown>:0
at EVEManager.GenericEVEManager`1[T].Setup () [0x00000] in <filename unknown>:0
at CelestialShadows.ShadowManager.Setup () [0x00000] in <filename unknown>:0
at EVEManager.GlobalEVEManager.Setup (Boolean late) [0x00000] in <filename unknown>:0
It looks like it is caused by the lack of null-check on this.sphere.
RemoveFromPQSCities being called by Remove, I suggest to split the existing null-check on this.sphere and replace it by something like:
if (this.sphere != null)
{
RemoveFromPQSCities();
if (this.sphere.quads != null)
{
My bad!
So, yes: it always occurs.
I have it happening when going back to Main menu from KSC.
But the problem doesn't seem to be EVE:
I overlooked my installation folder and didn't noticed I left Scatterer and SVE in it!
When removing Scatterer, the problem disappear!
So I suppose it have something to do with this error...
Again: sorry!
The fix is correct regardless, so I'll post it in a new update soon. We all use Scatterer :-)