That’s...not at all clear (there is no such legal requirement, though there were some NATO members who publicly suggested that resolving the territorial disputes with Russia first was their then-current diplomatic position at various times in the discussion of the possibility. But diplomatic positions are sometimes prone to change in response to inducements from parties with different preferences.)
Russia wouldnt attack both Georgia and Ukraine, and spend billions of resources just for the 0% chance of Ukrainian and Georgian NATO admission. Both Montenegro and Macedonia joined NATO in a matter of months, in the latter case when the regime was toppled. Enabling any talks between NATO and Ukraine/Georgia would be considered extremely terrifying for the national security of Russia.
[1]https://www.eurasian-research.org/publication/geography-of-t...
There was a 0% chance of Ukraine joining NATO in the next N years prior to Russia's invasion of them in 2021.
Even if by some twisted logic that were pretext for a quote-unquote "just war", it cannot be a justification for the land grab Russia is making in Ukraine today, killing civilians and committing various war crimes on the daily to do it.