Adding condition to check if empty

Display error message and disconnect from server if the field are empty