-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Permissions: Protect GetIdsFromPathReversed against invalid program exception
#20930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -51,16 +51,23 @@ static StringExtensions() | |||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| /// <summary> | ||||||||||||||
| /// Convert a path to node ids in the order from right to left (deepest to shallowest) | ||||||||||||||
| /// Convert a path to node ids in the order from right to left (deepest to shallowest). | ||||||||||||||
| /// </summary> | ||||||||||||||
| /// <param name="path"></param> | ||||||||||||||
| /// <returns></returns> | ||||||||||||||
| /// <param name="path">The path string expected as a comma delimited collection if integers.</param> | ||||||||||||||
| /// <returns>An array of integers matching the provided path.</returns> | ||||||||||||||
| public static int[] GetIdsFromPathReversed(this string path) | ||||||||||||||
| { | ||||||||||||||
|
||||||||||||||
| { | |
| { | |
| if (string.IsNullOrEmpty(path)) | |
| { | |
| return Array.Empty<int>(); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This this is OK as is. We accept string, not string? as input to this function. I added a null input for the test just to verify that we don't get a failure if somehow a null was coerced in.
Uh oh!
There was an error while loading. Please reload this page.