Fell asleep breastfeeding and I feel awful

This evening I was feeding my baby in a side lying position in bed while my husband was also in the room working on his computer. I don't even remember feeling tired but next thing I know I was waking up and baby was still nursing, and my husband was in bed beside me, half asleep. I asked him what time it was and apparently it was 45 minutes later than when I got in bed. I have occasionally coslept with baby before for naps following the safe sleep 7, but this time I wasn't expecting to fall asleep so there were blankets and pillows around and I wasn't in the cuddle curl. Her head was so close to the pillow. I still feel so shocked and mortified that I put my baby in danger. I've definitely learned to just go ahead and get in a safe sleep position if I'm nursing side lying, even if I don't think I'm tired. I don't know why I'm sharing this but I am so emotional and feel like garbage. I also don't know if it's fair to be upset with my husband for not waking me up.