Transform.parent returns only null

I am trying to find an object that is the parent of the object that instantiates a projectile:

GameObject bulletInstance;

       bulletInstance = Instantiate(bulletPrefab, firePoint.position, firePoint.rotation);


                  bulletInstance.GetComponent<bullet>().MainPlayer = transform;

This code informs the bullet of what shot it, and that works.

 REALPLAYER = MainPlayer.transform.parent;

When I debug.log for MainPlayer, it returns the proper result, the weapon. But if I debug.log for RealPlayer, it returns Null. How to fix?

You are accessing the transform of a transform just leave MainPlayer.parent since mailplayer iw a transform