Steps to reproduce:
1. Create a new world and turn off "Generate Structures" in the Create New World screen.
2. In the game, type /locate village (or any structure).
Observed result: Initially nothing appears to happen, except that it takes a very long time to do anything. After maybe 10 seconds or so, if you try to exit the game to the main screen, the "Saving world" screen simply hangs. The only way to close is via the task manager. (This results in a crash according to the launcher, but I think that's a secondary effect of killing the instance while it's stuck in some sort of loop - there's no recent crash log in the .Minecraft\crash-reports folder, though ).
Expected result: The game should check to see if "Generate structures" was selected, and say, "No structures were generated in this world."
Linked issues
Comments

Thank you for your report!
However, this issue is a Duplicate of MC-126244.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki