Maybe the player pointer is not initialised at the begin of your ghost1 action. Set following at the begin of your ghost1 action:

while (!player) wait(1);

That will wait till the player pointer is filled with "player = my;" in your pacman action.