title: Unity RPC Null reference exception
body: <p>I'm trying to make my first server/client game on unity, and get stuck with RPC. I'm getting a very strange Null reference exception here:</p>
  
  <pre><code>for (int b = 1; b &lt;= Network.connections.Length; b++)
  {   
      playerList[b] = genPlayer(Network.connections[b-1]);
      Debug.Log(
          "player " + b + 
          " has ip " + Network.connections[b - 1].ipAddress + 
          " port " + Network.connections[b - 1].port + 
          " with ID " + playerList[b].ID + 
          " and info: " + playerList[b].info.guid);
      networkView.RPC("GetID", playerList[b].info, playerList[b].ID, b);
      ResendHand(playerList[b]);
  }
  </code></pre>
  
  <p>while the genPlayer:</p>
  
  <pre><code>public player genPlayer(NetworkPlayer plr)
  {
      Debug.Log("the new player added from: " + plr.ipAddress);                   
      player pl = new player();
      pl.ID = getID();//just a random int
      pl.card1 = getCard(pl.ID); //random card
      pl.card2 = getCard(pl.ID);
      pl.card3 = getCard(pl.ID);
      pl.card4 = getCard(pl.ID);
      pl.card5 = getCard(pl.ID);
      pl.score = 0;
      pl.vote = 0;
      pl.info = plr;            
      Debug.Log("the player was generated successfully with  " +  "ID " + pl.ID);
      return pl;
  }
  </code></pre>
  
  <p>And here are messages:</p>
  
  <blockquote>
    <p>the new player added from: 169.254.80.80</p>
    
    <p>the player was generated successfully with  ID 664652695</p>
    
    <p>player 1 has ip 169.254.80.80 port 50571 with ID 664652695 and info: 1</p>
    
    <p>NullReferenceException ServerOperations.StartTheGame () (at
    Assets/ServerOperations.cs:66)</p>
  </blockquote>