Skip to content

Commit e244523

Browse files
committed
Do not demand for PointerMoveInteraction.target to be not-null
1 parent 23cf0af commit e244523

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

dotnet/src/webdriver/Interactions/PointerInputDevice.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,6 @@ public Interaction CreatePointerMove(IWebElement target, int xOffset, int yOffse
237237
/// <exception cref="ArgumentNullException">If <paramref name="target"/> is <see langword="null"/>.</exception>
238238
public Interaction CreatePointerMove(IWebElement target, int xOffset, int yOffset, TimeSpan duration, PointerEventProperties properties)
239239
{
240-
if (target is null)
241-
{
242-
throw new ArgumentNullException(nameof(target));
243-
}
244-
245240
return new PointerMoveInteraction(this, target, CoordinateOrigin.Element, xOffset, yOffset, duration, properties);
246241
}
247242

@@ -590,7 +585,7 @@ public override string ToString()
590585
string originDescription = this.origin.ToString();
591586
if (this.origin == CoordinateOrigin.Element)
592587
{
593-
originDescription = this.target!.ToString()!;
588+
originDescription = this.target?.ToString() ?? "<null>";
594589
}
595590

596591
return string.Format(CultureInfo.InvariantCulture, "Pointer move [origin: {0}, x offset: {1}, y offset: {2}, duration: {3}ms]", originDescription, this.x, this.y, this.duration.TotalMilliseconds);

0 commit comments

Comments
 (0)