Skip to content

Commit ad49667

Browse files
committed
Add null check to CreatePointerMove
1 parent fef6ec6 commit ad49667

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dotnet/src/webdriver/Interactions/PointerInputDevice.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ public Interaction CreatePointerUp(MouseButton button, PointerEventProperties pr
219219
/// <param name="yOffset">The vertical offset from the origin of the move.</param>
220220
/// <param name="duration">The length of time the move gesture takes to complete.</param>
221221
/// <returns>The action representing the pointer move gesture.</returns>
222+
/// <exception cref="ArgumentNullException">If <paramref name="target"/> is <see langword="null"/>.</exception>
222223
public Interaction CreatePointerMove(IWebElement target, int xOffset, int yOffset, TimeSpan duration)
223224
{
224225
return CreatePointerMove(target, xOffset, yOffset, duration, new PointerEventProperties());
@@ -233,8 +234,14 @@ public Interaction CreatePointerMove(IWebElement target, int xOffset, int yOffse
233234
/// <param name="duration">The length of time the move gesture takes to complete.</param>
234235
/// <param name="properties">The specifications for the pointer event interaction</param>
235236
/// <returns>The action representing the pointer move gesture.</returns>
237+
/// <exception cref="ArgumentNullException">If <paramref name="target"/> is <see langword="null"/>.</exception>
236238
public Interaction CreatePointerMove(IWebElement target, int xOffset, int yOffset, TimeSpan duration, PointerEventProperties properties)
237239
{
240+
if (target is null)
241+
{
242+
throw new ArgumentNullException(nameof(target));
243+
}
244+
238245
return new PointerMoveInteraction(this, target, CoordinateOrigin.Element, xOffset, yOffset, duration, properties);
239246
}
240247

0 commit comments

Comments
 (0)