Breastfeeding while pregnant is absolutely fine. There is no research showing that you will miscarry, unless there's a severe history of miscarriage, while you're breastfeeding. A lot of times when women are in their later stages of pregnancy, and they're closer to the time where they're ready to deliver, nipple stimulation might send them into labor. There's no evidence stating that breastfeeding during pregnancy will actually cause that stimulation in order to miscarry.
If you're breastfeeding while pregnant, it is absolutely fine to do. Just know that it's possible that your baby may reject the breast around the five month mark when your colostrum starts to come in again, because it has to gear up for the current baby. So it's not surprising when many children start to wean at that stage, because the taste changes. But other than that, if you are breastfeeding while you're pregnant, it's a beautiful bonding experience to continue with your older child. But just know that if they do start to reject the breast, that that might be the reason why.