Preemptive strikes exist. Law does not need to apply after the fact if the law is allowed preventive measures.
And arguing about if one should take such a preventive strike, yes they should since the perp has already declared threatening intentions to cause immediate harm.