Strange bug, closing panel

Hi, I’m wondering, I need help from someone, I noticed that the function “panel.SetActive (player! = null);”, check if the player is in the world and yes yes activates the panel, I’m using the same configuration and at startup it closes the panel, instead of opening, my script:

using UnityEngine;
using UnityEngine.UI;

public partial class UIMiniHealthMana : MonoBehaviour
{
    public GameObject panel;
    public Slider healthSlider;
    public Slider manaSlider;
 
    void Update()
    {
			
        Player player = Utils.ClientLocalPlayer();
        panel.SetActive(player != null); // hide while not in the game world
        if (!player) return;

        healthSlider.value = player.HealthPercent();

        manaSlider.value = player.ManaPercent();
		
    }
	
}

Try this instead:

void Update()
{
    Player player = Utils.ClientLocalPlayer();
    if(player != null)
    {
        panel.SetActive(true);
        healthSlider.value = player.HealthPercent();
        manaSlider.value = player.ManaPercent();
    }
    else
    {
        panel.SetActive(false);
    }
}