HDMI is supposed to be hot-swap capable. If you look at the pins, some of them are slightly longer than the others - those are the ground pins and are supposed to make contact first. Problem is that cable quality can vary greatly and sometimes wear-and-tear can cause the initial contact to be other than as designed. Other USB and mic/earphone connections, it's safer to just connect when the system is powered down.