Remove an unnecessary null check.

If pathname isn't null, then getName can't be null.

Plus, getName returns an empty string if no filename is in the path.