Skip to content
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

BugFix - 39725 - Exception When Selecting Element Without Screenshot #3834

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ internal static string GenerateRelativeXPathFromHTMLElementInfo(HTMLElementInfo
!_pomSetting.LearnScreenshotsOfElements ||
browserElement == null)
{
return string.Empty;
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider handling potential null returns in client code.

The change to return null instead of an empty string in the GetElementScreenshotAsync method is significant. This could potentially lead to NullReferenceException in parts of the code that consume this method but do not expect a null value.

- return null;
+ return null; // Ensure that all callers of this method handle the potential null value appropriately.

Ensure that all client code that calls this method is updated to handle null values to prevent runtime errors.

Committable suggestion was skipped due to low confidence.

}

try
Expand Down
Loading