Error C# NullReference

When i click on the buttons that are supposed to change the color i get this error

NullReferenceException: Object reference not set to an instance of an object
CharacterCustomizer.SetColor (System.Int32 colorIndex)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using Photon.Pun;

public class CharacterCustomizer : MonoBehaviour
{
    [SerializeField] Color[] allColors;

    public void SetColor(int colorIndex)
    {
        PlayerInfo.PI.SetColor(allColors[colorIndex]);
    }
}

Just found the problem, i was not enabling a trigger bool in another scripting that was conflicting on this function, but thanks btw.