The Messenger of Allah (ﷺ) was in a cave (or raid) when his finger was hurt. Sahih Muslim Book 32, Hadith 137