Atomic issue - Capture King while in check?
Strictly speaking it should not be legal to expose your King to destruction by explosion, just like it is not legal to expose it to normal capture. Many computer implementations do not enforce this rule, though.
The difference manifests itself in the detection of stalemate. E.g. the above position would be stalemate when exposing a King to explosion is not legal, but is a loss if it is legal.
When it is not legal, the situation mentioned in the leading posting cannot occur.