The Quran says The same religion has He established for you as that which He enjoined on Noah—the which We have sent by inspiration to thee—and that which We enjoined on Abraham, Moses, and Jesus: Namely, that ye should remain steadfast in religion, and make no divisions therein:... — Quran, sura 42 (Ash-Shura), ayah 13 Islam teaches that prophets were "protected from sin" by God, so unlike lesser human beings they cannot commit a sin.
الآيه وبقوله تعالى : ((شرع لكم من الدين ماوصى به نوحاً والذي أوحينا إليك وما وصينا به إبراهيم وموسى وعيسى أن أقيموا الدين ولاتتفرقوا فيه...))