Help With NullReferanceExeption

 private void GetComponents()
    {
        player = GameObject.FindGameObjectWithTag("Player").transform;
        playerController = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>(); 
        rb = GetComponent<Rigidbody2D>();
    }

the above method is called in start functio.
So the problem is when player is dead it gives a nullreferance exepction although I did check if it is null in update function