Sayyiduna Jabir bin Abdullah (may Allah be pleased with them both) related that he went on a campaign with the Messenger of Allah (peace and blessings be upon him) towards Najd. When the Messenger of Allah (peace and blessings be upon him) returned, he returned with him. One day the time of the midday rest came upon them in a valley full of thorny trees. The Messenger of Allah (peace and blessings be upon him) dismounted, and the people spread out among the trees seeking shade, and the Messenger of Allah (peace and blessings be upon him) also stopped under a tree. He (peace and blessings be upon him) hung his sword on the tree. Jabir (may Allah be pleased with him) said: We slept, and when the Messenger of Allah (peace and blessings be upon him) called us, we answered (and went to him), and saw a Bedouin sitting with him (peace and blessings be upon him). The Messenger of Allah (peace and blessings be upon him) said: "This man drew my own sword against me; I woke up and it was in his hand, unsheathed. He said: 'Who will protect you from me?' I said: 'Allah!' He said a second time: 'Who will protect you from me?' I said: 'Allah.'" Then he put the sword back in its sheath and sat down. The Messenger of Allah (peace and blessings be upon him) did not punish him.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب قسم الفيء والغنيمة / 12834