Fix possible crash when parsing files for waypoints related to directory being set as a file.