baby chewing crib help

I just woke up to this from a nap and I'm so worried - I'm wondering has anyone else's kid done this and how to prevent it -It's a mini crib so don't see any guard rails that fit  mini