value check does not work

Please tell me why this design does not work. I want her to just activate the object or deactivate it.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BuildMenu : MonoBehaviour
{

    public GameObject ButtonSave;
    public GameObject ButtonDel;


    public void SetActiveButton()
    {
        if (ButtonSave == false)
        {
            ButtonSave.SetActive(true);
            ButtonDel.SetActive(true);
        }
        else
        {
            ButtonSave.SetActive(false);
            ButtonDel.SetActive(false);
        }

    }

What do you think line 14 does? “ButtonSave” is of type GameObject, not bool. ButtonSave will always resolve to true so long as it exists, so assuming ButtonSave isn’t null then lines 16 and 17 will never be executed.

See Object.bool for info:

edit:
Did you mean to check ButtonSave.activeInHierarchy?

thanks, now I understand what the mistake is