RPC Parameter is null

Options


I have a code in my Unity game, I'm using Photon's PUN2, and I wanted to call an RPC function:

 if (SLock == 0)
        {
            print("Trying Setting RPC");
            //PV = gameObject.AddComponent<PhotonView>() as PhotonView;
            PV.RPC("Setting", RpcTarget.All, new object[] { BehaviourModel.OnlineArray });
            Lock++;
        }

        print(BehaviourModel.OnlineArray);
        print("SLock : " + SLock);
        BehaviourModel.LoadOnline();

    }
    [PunRPC]
    void Setting(string[] OnlineA)
    {
        print("In Settings");

        Norandomarray = new string[]
         {
            "LabyrinthGame", "ColorGame", "ButtonBoard" , "SliderGame", "FallGame", "BalloonGame", "PizzaGame", "CardGame", "RollGame", "SwitchGame"
         };
        OnlineA = Norandomarray.OrderBy(C => Rnd.Next()).ToArray();
          BehaviourModel.OnlineArray = OnlineA;
          print("Setted");

    }
To this point all right, as you can see, there are some print lines to show messages to the console, the game yes prints this messages until this line:

OnlineA = Norandomarray.OrderBy(C => Rnd.Next()).ToArray();
It marks a NullReferenceException, saying that the OnlineArray is null, and, in fact, is null, but that's why I want to set its value by this RPC (NoRandomArray isn't null). So, any idea of what's happening here? I have seen other codes and nothing like this happened.

PS: You may be wondering why I'm doing this, it's easy, I just need to have an array that has the same values as the Norandomarray, but, in different order (as you can see in the code) and sync this array to all the players so they have this same value in same order.