ʿUmar went to Sham and when he reached Sargh, he got the news that an epidemic (of plague) had broken out in Sham. ʿAbdur-Rahman bin ʿAuf told him that Messenger of Allah ﷺ said, "If you hear that it (plague) has broken out in a land, do not go to it; but if it breaks out in a land where you are present, do not go out escaping from it." (Using translation from Bukhārī 5730)
أَنَّ عُمَرَ خَرَجَ إِلَى الشَّامِ حَتَّى إِذَا كَانُوا بِسَرْغَ بَلَغَهُ أَنَّ الْوَبَاءَ قَدْ وَقَعَ بِالشَّامِ فَأَخْبَرَهُ عَبْدُ الرَّحْمَنِ بْنُ عَوْفٍ أَنَّ رَسُولَ اللهِ ﷺ قَالَ «إِذَا سَمِعْتُمْ بِهِ بِأَرْضٍ فَلَا تَقْدُمُوا عَلَيْهِ وَإِذَا وَقَعَ بِأَرْضٍ وَأَنْتُمْ بِهَا فَلَا تَخْرُجُوا فِرَارًا مِنْهُ» فَرَجَعَ عُمَرُ مِنْ سَرْغَ