This phrase is a humorous way of saying that when someone gets injured or hurt during a joke or funny moment, the humor quickly evaporates and is replaced by concern for the welfare of the person who has been hurt. In other words, when someone is hurt, it stops being funny, but if no one gets hurt it can be very funny.