Relationships

I have been with my boyfriend for 4 years. Almost 2 years ago now he got another "random one nighter" girl pregnant. Was I wrong to stay?