This is a serious mistake most people make while going into relationships; they don't verify these things first and they are very important but there are ways around it if you have made the mistake and you cant bare the loss of your relationship.
I agree that it would be okey for them to stay together and decided not to have children or even adopt one instead.
But I doubt that is an option, since I have learnt from people living in Africa and also users on this forum that having children is an important part of the family culture there and not getting married and not procreating can lead to being socially rejected or stuff like that. In my opinion it is non-sense, since I am from the Americas; but I get how different cultures can be around the world.
I have learnt more about African culture since I joined this forum, tbh.