The sentiments which a man of generosity entertains for the friend who fails, may often indeed be nearly the same with those which he conceives for him who succeeds
 Adam Smith, The Theory of Moral Sentiments (1759). copy citation

Context

“It is common indeed to say, that we are equally obliged to the man who has endeavoured to serve us, as to him who actually did so. It is the speech which we constantly make upon every unsuccessful attempt of this kind; but which, like all other fine speeches, must be understood with a grain of allowance. The sentiments which a man of generosity entertains for the friend who fails, may often indeed be nearly the same with those which he conceives for him who succeeds: and the more generous he is, the more nearly will those sentiments approach to an exact level. With the truly generous, to be beloved, to be esteemed by those whom they themselves think worthy of esteem, gives more pleasure, and thereby excites more gratitude, than all the advantages which they can ever expect from those sentiments.” source