As stupid as having invented nuclear weapons is, the stupidity of everything else following it makes artificial intelligence correcting monumental stupidity even more dangerous for humans than nukes because humans are the cause that is the problem to a higher intelligence.
Edit:// by that I mean, AI poses a greater threat of causing human extinction than nuclear weapons. The next level of human stupidity after nukes is creating an intelligence that is not stupid which will inevitably be tasked to solve the world's problems when humans are the problem causing the problems.