I think you should use PathManager.resolveRelativePathEntry regardless of if relativeTo is null or not