It was not a treaty, but the
Budapest Memorandum on Security Assurances, which was only a political agreement, and not a ratified treaty. Therefore it is not worth the paper it was written on, and the Ukrainians were foolish enough to sign it and give up their nukes.