She shattered a stranger’s car window. Did she do the right thing?

She shattered a stranger’s car window. Did she do the right thing?

“I went to Walmart on Thursday and I parked next to a car that had a golden retriever in the backseat with the windows up. It was about 85 out, so as a pet lover I was worried.
When I came out 20 minutes later their windows were still up, so I broke their window.
Someone saw me and screamed that they were going to call the police. They took down my license plate and said they’d leave it for the owner.
Did I do the right thing, and what kind of trouble could I be in?”