Our Rabbis taught: [When there is] famine in the city, spread your feet [depart], as it is said, "and there was a famine in the land, and Abram went down to Egypt." And it says, "If we say, We will enter the city, then the famine is in the city" (II Kings 7:4). What is the force of "and it says"? And should you say, this applies only where there is no doubt concerning lives at stake, but where there is doubt concerning lives at stake one should not [leave], the verse teaches, "If we say, We will enter the city" [showing that even amid danger to life one should depart].
In Famine Spread Your Feet and Leave
Yalkut Shimoni on Torah 67:4
תָּנוּ רַבָּנָן, רָעָב בָּעִיר פַּזֵּר רַגְלֶיךָ שֶׁנֶּאֱמַר, וַיְּהִי רָעָב בָּאָרֶץ וַיֵּרֶד אַבְרָם מִצְרַיְמָה, וְאוֹמֵר "אִם אָמַרְנוּ נָבוֹא הָעִיר וְהָרָעָב בָּעִיר" מַאי וְאוֹמֵר, וְכִי תֵּימָא הֲנֵי מִילֵי הֵיכָא דְּלֵיכָּא סָפֵק נְפָשׁוֹת אֲבָל הֵיכָא דְּאִיכָא סָפֵק נְפָשׁוֹת לֹא, תַּלְמוּד לוֹמַר "אִם אָמַרְנוּ נָבוֹא הָעִיר".