Error when calling Peer.ValidateOperation

edited April 2011 in Photon Server
We have began testing our new server, and one of our testers have caused the following error to show in the logs:
2011-04-05 05:58:22,703 [4] ERROR Photon.SocketServer.ErrorHandler [(null)] - System.NullReferenceException: Object reference not set to an instance of an object.
at Photon.SocketServer.Rpc.Operation.GetErrorMessage() in c:\dev\photon-socketserver-sdk\src\Photon.SocketServer\Rpc\Operation.cs:line 169
at CashKingServer.CashKingPeer.ValidateOperation(Operation operation)

I'm assuming said operation got a null into one of it's RequestParameters, but shouldn't the ValidateOperation function handle these sorts of validation issues as well?


  • Boris
    Boris ✭✭
    did that happen with a flash client or unity/iphone/etc?

    I assume it happens when one of the request.Params has a null value, so the root cause is probably the deserialization as we don't support null values in the protocol.
  • There is an issue in the GetErrorMessage function if the parameters of the OperationRequest would be modified between creating the Operation and calling the GetErrorMessage function.
    Currently the GetErrorMessage function should be called directly after creating the Operation.
    We will fix this issue with the next release.

    Hope this helps to solve your problem