That's not why she had an affair so as 2pak has suggested, it doesn't seem like you're being honest with yourself and if that was your wife's excuse, I would postulate that you may have accepted that excuse from her out of guilt from your behavior. Both women AND men don't have affairs because someone was on drugs or alcohol or any other addiction. From my decades of observation and experience, most affairs happen because of a need not being met (emotional, sexual, etc.) or an unhealed wound from the marriage OR from childhood (vs very few who have sex outside of marriage just because of an opportunity happened and it was taken or one succumbed to the temptation). Also, the reason for the infidelity will many times greatly impact the length of the infidelity.
One analysis of a large US university survey of people who cheated found eight key reasons for cheating: anger, self-esteem, lack of love, low commitment, need for variety, neglect, sexual desire, and situation or circumstance (which seems to support what I previously shared). The analysis goes on to say that these motivations not only influenced why people cheated but how long they did so, their sexual enjoyment, their emotional investment in the affair and whether their primary relationship ended as a result.