FAQ: Illegal Target
If a card effect specifies targets, it checks whether the targets are legal when it is played and when it resolves. A target can become illegal if it is removed rom play, if it is removed from the zone specified in the ability, or if any specific characteristics on the card that were targeted have changed. If all of the targets for a card effect become illegal, then the card effect is cancelled. If any of the targets are still legal when the card effect resolves, then the card effect will resolve normally, only affecting the legal targets.
So what happens, when a target is illegal while playing? Am I still allowed to play the card for reducing hand size/spending resources ?