If a player gets attacked and then a form of automatic protection is invoked so he/she cannot be attacked for say 24 hours then that is a good thing.
BUT if an attacker loses his/her troops as a result of choosing to attack another player he/she should not get protection at all. ELse what will happen is that a player will attack someone knowing that even if they lose they cannot be attacked for a given period of time and in that period of time they can rebuild or have troops donated to them by others.