Fix: down-arrow and enter key throwing error when input field is empty

Pressing down-arrow or enter key throws an error when input field is empty.