if input doesnt exist - I get an error

if input doesnt exist - I get an error

I get an error:

Error occured while executing the script.
Unable to evaluate if/while Condition
If the input is left blank.

I want the user to  input at least three characters

I'm using this:   

<%if ((input.searchStr).length()  >  3)
    {%>
We have three
    <%}

How do I change the if statement to see if input.searchStr exists at all?

Thanks,

Dan