AHMAD 6975:
from ʿAmr b. Shuʿayb from his father from his grandfather —
[Machine] The Messenger of Allah ﷺ looked at a Bedouin standing in the sun while he was delivering a sermon. The Prophet asked, "What is your intention?" The Bedouin replied, "O Messenger of Allah, I have made a vow that I would not leave the sun until you finish." The Messenger of Allah ﷺ said, "This is not a vow. A vow is only something intended to seek the pleasure of Allah Almighty."
أحمد ٦٩٧٥:
عن عمرو بن شعيب عن أبيه عن جده —
أَنَّ رَسُولَ اللهِ ﷺ نَظَرَ إِلَى أَعْرَابِيٍّ قَائِمًا فِي الشَّمْسِ وَهُوَ يَخْطُبُ فَقَالَ مَا شَأْنُكَ؟ قَالَ نَذَرْتُ يَا رَسُولَ اللهِ أَنْ لَا أَزَالَ فِي الشَّمْسِ حَتَّى تَفْرُغَ فَقَالَ رَسُولُ اللهِ ﷺ لَيْسَ هَذَا نَذْرًا إِنَّمَا النَّذْرُ مَا ابْتُغِيَ بِهِ وَجْهُ اللهِ ﷻ
hadithunlocked.com