"Israel is a nation of whom God thought even before the creation of the world. It is the rock upon which the world is founded. For, when God was considering the scheme of the creation, He thought, 'How can I create the world if the idolatrous generation of Enosh and the generation of the flood will arouse My anger?' He was about to desist from the creation of the world, when He saw before Him Abraham's form, and He said, 'Now I have a rock upon which I can build, one upon which I can found the world.' How, too, should I curse this nation that are protected and surrounded by the merits of the Patriarchs and the wives of the Patriarchs as if by lofty mountains and steep hills, so that if Israel sin, God forgives them as soon as Moses prays to Him to be mindful of the Patriarchs!
God Almost Abandoned Creation Because of Future Sinners
Legends of the Jews 6:40