fix issue with file link

Check if $file is essentially blank, and if so, don't append the file
link.