Hadith 1366
Ma'qil bin Yasar (May Allah be pleased with him) reported:
عن معقل بن يسار رضي الله عنه قال: قال رسول الله صلى الله عليه وسلم : "العبادة في الهرج كهجرة إلي" ((رواه مسلم)).
The Messenger of Allah (ﷺ) said, "The reward of worship performed at a time of trials is equal in reward to an emigration to me." [Muslim].
In plain words
Worship held to during times of turmoil and confusion is rewarded like emigrating to the Prophet (peace be upon him). Staying steady in devotion when others are swept away is especially beloved to Allah.
Reference : Riyad as-Salihin 1366 In-book reference : Book 11, Hadith 82