Trick for crawling babies near door hinges

My toddler is always slamming the bathroom door. Freaks me out when his little sister is crawling nearby. She likes to stick her fingers in the space where the door hinges meet the frame. Note that the door opens outward, which is a little unusual for a bathroom door. (Don’t ask me, old house.) I opened the door as much as I could (so that the inner edge of the door and the frame are parallel). I then cut some foam rubber into a strip about 3″ wide and duct-taped it vertically against the inner edge of the door and the door frame (bridging the gap). When you close the door, it folds the foam rubber in half. The fold also slightly pops out of the crack between the door and the frame. This is what keeps curious fingers out of the gap. Hope this trick saves a few ER visits!