Assalamu Alaykum

I have a question about a weird thing that happened today while I was fasting .I feel ashamed to ask about it but I need to know this. There are some cats around my house so one of them came and I thought I should feed her so I was trying to pet her so that she doesnt run away everytime i try to feed her .the weird part is here while doing so madhiy came out idk why this happened i feel ashamed just thinking of it. so I paniced I didnt know if i broke fast or not so I continued to fast.Is my fasting valid or not.