Is it OK to ride with a shortened chain?

A couple of days ago, while I was riding around my house on my MTB, the chain snapped. What I’m guessing happened is that I might have continued pedalling even though the chain had not completely shifted. I came home, and removed the broken link and one more link to make sure that I had…