Skip to content

Commit

Permalink
Add null check to CreateWheelScroll
Browse files Browse the repository at this point in the history
  • Loading branch information
RenderMichael committed Dec 2, 2024
1 parent ad49667 commit 23cf0af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dotnet/src/webdriver/Interactions/WheelInputDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,14 @@ public Interaction CreateWheelScroll(int deltaX, int deltaY, TimeSpan duration)
/// <param name="deltaY">The distance along the Y axis to scroll using the wheel.</param>
/// <param name="duration">The duration of the scroll action.</param>
/// <returns>The <see cref="Interaction"/> representing the wheel scroll.</returns>
/// <exception cref="ArgumentNullException">If <paramref name="target"/> is <see langword="null"/>.</exception>
public Interaction CreateWheelScroll(IWebElement target, int xOffset, int yOffset, int deltaX, int deltaY, TimeSpan duration)
{
if (target is null)
{
throw new ArgumentNullException(nameof(target));
}

return new WheelScrollInteraction(this, target, CoordinateOrigin.Element, xOffset, yOffset, deltaX, deltaY, duration);
}

Expand Down

0 comments on commit 23cf0af

Please sign in to comment.