There are ways to protect from EMP. I won’t go into details but they have existed since we first detected them.
Oh, I know there are ways to protect one’s electronics. But, if one side protects their electronics, and has the cables, and devices hardened and in protected space, and subsequently sets off an EMP, what happens is nothing. Because BOTH sides have set in protections. MAD, indeed.