fix panic when watching file/dir is empty