Fix NPE when user inputs empty string