This is a warning, not an error, so you can probably just turn off warnings on the page and ignore it.
For some reason the delete record code is running on a blank value. That makes it think you are trying to delete the directory and it gives that warning. I'd say just turn off error reporting on the page and ignore it if everything else seems to work properly.