Custom post processing effects gets deleted randomly from profile. Null Error in TextureParameter

Hey guys !!!

I´ve been writting some custo post processing effects lately and I have just hit a big roadblock : The ones that use an extra texture dissapear from their profiles randomly , making my tuning progress dissapear and its really frustrating .

Every time I add the custom effect , an “Argument Cannot be Null” error shows up and points to what I think is my Texture , so maybe I´m declaring it wrong? Here is my code.

public sealed class PostProcessingEffect_TextureOverlay : PostProcessEffectSettings
{
    [Tooltip("Texture To Apply")]
    public TextureParameter overlayTexture = new TextureParameter();
    [Range(0f, 1f), Tooltip("Effect Opacity")]
    public FloatParameter opacity = new FloatParameter { value = 0.5f };
    [Range(0f, 1f), Tooltip("Original Pixel Blending")]
    public FloatParameter blending = new FloatParameter { value = 0.0f };
    [Tooltip("Texture Rows ")]
    public IntParameter rows = new IntParameter { value = 1 };
    [Tooltip("Texture Colums ")]
    public IntParameter colums = new IntParameter { value = 1 };
    [Range(0.0f,60.0f), Tooltip("Animation Speed ")]
    public FloatParameter AnimationSpeed = new FloatParameter { value = 1.0f };
    [ Tooltip("Uses Negate Effect Texture ")]
    public BoolParameter usesNegateTexture = new BoolParameter { value = false };
    [Tooltip("Negate Effect Texture")]
    public TextureParameter negateEffectTexture = new TextureParameter();
    [Range(0f, 1f), Tooltip("Negate Texture Alpha Cutout")]
    public FloatParameter alphaCutout = new FloatParameter { value = 0.0f };
    [Range(0f, 1f), Tooltip("Negate Texture Blend")]
    public FloatParameter negateBlend = new FloatParameter { value = 0.0f };

    public override bool IsEnabledAndSupported(PostProcessRenderContext context)
    {
        return enabled.value && (overlayTexture != null) && (opacity>0);
    }
}

Looking forward to your help.

I just updated the IsEnabledAndSupported function to be a bit more precise but it keeps giving me errors , please help !!!

    public override bool IsEnabledAndSupported(PostProcessRenderContext context)
    {
        return enabled.value && (overlayTexture != null) && (opacity > 0) &&
            (
            (usesNegateTexture == true && negateEffectTexture != null)
            ||
            (usesNegateTexture==false && negateEffectTexture==null)
            );
    }