Having just watched a clip of the incident, the linesman flagging for offside and play stopping does stop this 100% BUT the collision with the post could easily happen with the player onside indeed I've seen players collide with the woodwork multiple times over the years and always worried about...