Trim the leading and trailing spaces before checking if the title is empty.
Based on feedback from Estefania:
I also tested if I could save an “empty” title with only a space and this worked. I would suggest trimming the leading and trailing spaces before checking if the title is empty.
Trim the leading and trailing spaces before checking if the title is empty.
Based on feedback from Estefania: