Sunan an-Nasa'i, Book 21, Hadith 135 (Nasa'i 1957)

It was narrated that Ibn 'Abbas said:

"The Messenger of Allah was asked about he children of the idolators and he said: 'Allah knows best what they would have done."'