A prolonged weakened economy doesn't necessarily prevent a country from developing a nuclear weapons program. Take a look at North Korea.
Only north korea had china to protect it, whereas iran has (to my knowledge) nobody wanting to risk anything for it.