Indeed, that condition was mentioned by Allah’s Apostle Shallallaahu ‘alayhe wa Sallam, in this following story:
In the authority of Abu Huraira -may Allah be pleased with him-, he said that: A man came to The Prophet Shallallaahu ‘alayhe wa Sallam and asked, “O The Messenger of Allah, which charity is the most superior in reward?” He replied,
“The charity which you practice while you are healthy, niggardly and afraid of poverty, and wish to become wealthy. Do not delay it to the time of approaching death and then say, Give so much to such and such, and so much to such and such. And it has already belonged to such and such (as it is too late).”
Collected by Bukharee, and this is his version, and by Muslim.