Iran has not (as of today) withdrawn from the non-proliferation treaty. All that has happened (as of now) is that the Iranian parliament is currently preparing a bill to withdraw, nothing more. Parliament will have to introduce and approve it, and the government will need to enforce it before Iran finally withdraws, and we don‘t know whether any of that will happen.
Iran’s current government (including the foreign ministry) is on record being against nuclear weapons, and the Supreme leader seems pretty much against them, whether or not that is a lie remains to be seen.
https://thearabweekly.com/iran-threatens-leave-nuclear-non-p...
Aside: The above link provides a calm summary of version events since USA withdrew from JCPOA, including the fact that Iran was in compliance until 2019; I advice you to read it and reevaluate your stance against treaties as an effective way to disarm states.
What I am arguing here is that the fact that a nuclear armed nation is now attacking Iran will increase the probability that Iran will eventually get nuclear weapons, while negotiating a treaty will do the opposite. Israel is definitely showing Iran a good reason for pursue nuclear weapons, and the military hawks inside Iran’s leadership definitely have a much stronger case now. Hopefully they will still fail at convincing the supreme leader of taking further steps in acquiring them, and remaining a member of the non-proliferation treaty.
Finally, a question. You seem to not believe that treaties are an effective way to disarm states. Why do you care whether or not Iran is a member of the non-proliferation treaty? According to your beliefs, it wouldn’t matter either way. Iran would be equally likely to get the bomb inside or outside the non-proliferation treaty.