Skip to content

Commit 23cf0af

Browse files
committed
Add null check to CreateWheelScroll
1 parent ad49667 commit 23cf0af

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

dotnet/src/webdriver/Interactions/WheelInputDevice.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,14 @@ public Interaction CreateWheelScroll(int deltaX, int deltaY, TimeSpan duration)
8989
/// <param name="deltaY">The distance along the Y axis to scroll using the wheel.</param>
9090
/// <param name="duration">The duration of the scroll action.</param>
9191
/// <returns>The <see cref="Interaction"/> representing the wheel scroll.</returns>
92+
/// <exception cref="ArgumentNullException">If <paramref name="target"/> is <see langword="null"/>.</exception>
9293
public Interaction CreateWheelScroll(IWebElement target, int xOffset, int yOffset, int deltaX, int deltaY, TimeSpan duration)
9394
{
95+
if (target is null)
96+
{
97+
throw new ArgumentNullException(nameof(target));
98+
}
99+
94100
return new WheelScrollInteraction(this, target, CoordinateOrigin.Element, xOffset, yOffset, deltaX, deltaY, duration);
95101
}
96102

0 commit comments

Comments
 (0)