Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…onoGame#8569) Fixes MonoGame#8568 ### Description of Change Adds a `Path.IsRootedPath` check on the `assetName` parameter, and if it is a rooted path, throws a `ContentLoadException` with a clear exception message on why the exception occurred. Previous behavior would have allowed a rooted path as the `assetName` parameter which would later throw a `FileNotFoundException` in the `ContentManager.OpenStream` method when attempting to open the stream. This is due to how `Path.Combine` works, where if the second parameter is a rooted path, it ignores the first parameter. While technically the `FileNotFoundException` is correct when the stream is attempted to open, the exception doesn't clearly describe to the developer why it occurred. The `assetName` parameter is defined as being a relative path, so if it is a rooted path, the exception should be thrown earlier to tell the developer they used a rooted path and need to use a relative path instead. <!-- Enter description of the fix in this section. Please be as descriptive as possible, future contributors will need to know *why* these changes are being made. For inspiration review the commit/PR history in the MonoGame repository. -->
- Loading branch information