Jabir said, "It was concerning us that the verse was revealed, 'When two parties among you were about to lose heart, but Allah was their protector' [Aal Imran 3:122]. The two parties were Banu Salama and Banu Haritha. We would not wish that it had not been revealed, because of Allah's words , 'Allah was their protector.'"
فينا نزلت: {إذ همت طائفتان منكم أن تفشلا والله وليهما} [سورة آل عمران: ١٢٢]: بنو سلمة، وبنو حارثة، وما نحب أنها لم تنزل، لقول الله عز وجل {الله وليهما}.
Bukhari narrated it in the Book of Military Expeditions (4051), and Muslim narrated it in the Virtues of the Companions (2505), both of them through Sufyan bin Uyayna, from Amr, from Jabir, who said, so he mentioned it. The wording given here is that of Muslim, and the wording of Bukhari is similar.