Error while checking file existance

Kindly help on below script:

<<

i='find ...'

if [ -f $i ] then
 echo 'File Exists'
else
  echo 'File Does Not Exist'

>>

If i has some file name then it runs properly but if i has nothing ( blank value) then it throws an error. I dont exactly remember right now but error seems like: "test:..parameter..."

To me it looks like if variablei does not have any file name if statements gets fail.

Could you please suggest me the right way to check if i has some file name and existence of file.

Thanks in advance

Check if variable is not empty and then proceed to avoid error:-

if [ ! -z "$i" ]
then
        if [ -f "$i" ]
        then
                echo "File exists"
        else
                echo "File doesn't exists"
        fi
fi

Not necessary. A [ -f "$i" ] is enough.