Check if theres input before throwing error

If a user does not input anything, the invalid-format error should not be shown.