A rally point is always set. The default rally point is at the building itself.
What you can do is detect whenever a building sets a rally point and store for that building, whether it is the default rally point or not.
With this information you can decide in your trigger, if you want to order the unit to harvest lumber.
Why would you even want to do this? If a player wants a unit to harvest lumber, the player can just set the tree as rally point.