Fix error message

`realpath` would return null if the file does not exist