-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[dotnet] Annotate nullability on more of WebElement
#15230
base: trunk
Are you sure you want to change the base?
[dotnet] Annotate nullability on more of WebElement
#15230
Conversation
PR Reviewer Guide 🔍(Review updated until commit d895b6b)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to d895b6b
Previous suggestions✅ Suggestions up to commit 2ea99a3
|
dotnet/src/webdriver/WebElement.cs
Outdated
} | ||
if (commandResponse.Value is null) | ||
{ | ||
throw new WebDriverException("GetElementValueOfCssProperty command returned a successful result, but contained no data"); |
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.
We should test it carefully.
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.
I tried to be very careful with this, to change no behavior. I read the spec, it says this will always be a string.
The only reason I am comfortable with this change, is because it would previously be a NullReferenceException
if this were null
. This way, users have something better to report if there is a bug here.
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 is very good insight. Please give me a chance to revisit it.
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Annotate nullability on more of
WebElement
Motivation and Context
Contributes to #14640
Types of changes
Checklist
PR Type
Enhancement, Bug fix
Description
Added nullability annotations to
WebElement
class for improved type safety.Enhanced error handling for null or unexpected responses in various methods.
Updated method signatures to reflect nullable return types where applicable.
Improved code readability and maintainability with structured nullability directives.
Changes walkthrough 📝
WebElement.cs
Add nullability annotations and enhance error handling
dotnet/src/webdriver/WebElement.cs