Fix app crash when entering no text and clicking Preview