Why does getting the position of and object return none?

There can be zero portals, but in the base case shown above (the one which gives me problems) both portals are placed.