JS-Check to see if input is empty before converting