OnTriggerExit gives me error, could someone check the code pls? (C#) (simple)

Hello, im playing around a bit with a building system from a unfinished tutorial and im trying to finish it, the porblem is that i need to correct some stuff and so on and yes, trouble what else ^^

void OnTriggerExit(Collider other)
{
    LiquidSorterIsPlaced foundation = other.GetComponent<LiquidSorterIsPlaced>();
    foundation.isSnapped = false;
}

this is 1 part of the code that gives me errors in the other code where i check if the object is placed and if not follow a raycast that is casted onto a terrain, for this im using some simple if stuff if(!isPlaced && !isSnapped)
public bool isPlaced;
public bool isSnapped;
these are my bools and the if stuff that i need, now i just cant get it why it is giving me errors when i leave the collider.

This is the code i used before, but it wont work with zooming so i need a new techniqe

if (isSnapped && !isPlaced && Mathf.Abs(MousePosiX - Input.GetAxis(“Mouse X”)) > 10f || Mathf.Abs(MousePosiY - Input.GetAxis(“Mouse Y”)) > 10f)
{
isSnapped = false;
}

Maybe the “other” object doesn’t have a “LiquidSorterIsPlaced”.
You can check it in your code:

void OnTriggerExit(Collider other)
 {
    if (other.GetComponent<LiquidSorterIsPlaced>() != null)
    {
         LiquidSorterIsPlaced foundation = other.GetComponent<LiquidSorterIsPlaced>();
         foundation.isSnapped = false;
    }
 }