True. I was preventing input of 2 or more spaces also, or a single non-blank plus space entry like 'x ' - which wasn't explicitly asked for! Yours does what was asked.
I presume the idea is to force users to type something meaningful. In the end, all such attempts are futile because they will just learn to type '..' or whatever. Even this forum tries to do that, forcing posts to contain at least 10 characters. Sometimes I try to answer a question with a pithy response like "Why?", and it gets rejected. So I might change it to something like "Why?????????"