NullRef in RPC() error handling when function name is wrong and there is no parameter (Pun 2.9)

Hello,

I haven't updated to the newest Pun but there's nothing about this bug in the 2.11 and 2.12 changelog (haven't seen the 2.10 changelog as it's not on the asset store).

If I call PhotonView.RPC() with a function name that has a typo, and the RPC call has zero custom arguments, then I get this nullref:

NullReferenceException: Object reference not set to an instance of an object
Photon.Pun.PhotonNetwork.ExecuteRpc (ExitGames.Client.Photon.Hashtable rpcData, Photon.Realtime.Player sender) (at Assets/Tools/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:506)

In case the code in PhotonNetworkPart.cs has changed since 2.9, here are the offending lines:
            // Error handling
            if (receivers != 1)
            {
                string argsString = string.Empty;
                for (int index = 0; index < argumentsTypes.Length; index++)
(more specifically the last one)

Comments

  • Hi @olistan,

    Are you saying this happens on 2.12 but not on 2.11?
    How can we reproduce? minimal steps required.
  • It happens on 2.9. I haven't tried 2.10, 2.11 or 2.12.

    To reproduce, just call GetComponent< PhotonView >().RPC("NonExistantFunction", RpcTarget.All).
Sign In or Register to comment.