[BUG REPORT] NullReferenceException in PhotonTeamsManager → OnPlayerLeftRoom(), OnPlayerEnteredRoom(

Options
When player has no team, GetPhotonTeam() will return null.

So in OnPlayerLeftRoom and OnPlayerEnteredRoom functions. It should avoid null reference exception because it's going to break other OnPlayerLeftRoom/OnPlayerEnteredRoom functions which made on other components (Because this function being called in loop)

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Insthync,

    Thank you for choosing Photon and for your report!

    We will investigate and try to reproduce the PhotonTeamsManager bug.

    About exceptions in callbacks, that's another story, we could add a try catch wrapper around each callback method call in the loop but that would hurt performance.
    We discussed this internally before but we are still open to ideas.
    We could start by documenting this I guess clearly on our website and put it as a warning.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi again @Insthync,

    NullReferenceExceptions fixed thanks to you.
    The fix and some other tiny PhotonTeamsManager updates will be out in the next update.
    Thanks again for your help.
  • Insthync
    Options
    Thank you :)