diff --git a/dotnet/src/webdriver/IHasDownloads.cs b/dotnet/src/webdriver/IHasDownloads.cs index a01d377758fa5..26680d66918ce 100644 --- a/dotnet/src/webdriver/IHasDownloads.cs +++ b/dotnet/src/webdriver/IHasDownloads.cs @@ -19,6 +19,8 @@ using System.Collections.Generic; +#nullable enable + namespace OpenQA.Selenium { /// diff --git a/dotnet/src/webdriver/Remote/RemoteWebDriver.cs b/dotnet/src/webdriver/Remote/RemoteWebDriver.cs index 4d46ac8df39f9..672f33a1cc17e 100644 --- a/dotnet/src/webdriver/Remote/RemoteWebDriver.cs +++ b/dotnet/src/webdriver/Remote/RemoteWebDriver.cs @@ -530,8 +530,8 @@ public IReadOnlyList GetDownloadableFiles() throw new WebDriverException("GetDownloadableFiles returned successfully, but response content was not an object: " + commandResponse.Value); } - object[] namesArray = (object[])value["names"]!; - return namesArray.Select(obj => obj.ToString()!).ToList(); + object?[] namesArray = (object?[])value["names"]!; + return namesArray.Select(obj => obj!.ToString()!).ToList(); } /// @@ -539,6 +539,7 @@ public IReadOnlyList GetDownloadableFiles() /// /// The name of the file to be downloaded. /// The target directory where the file should be downloaded to. + /// If is null. public void DownloadFile(string fileName, string targetDirectory) { var enableDownloads = this.Capabilities.GetCapability(CapabilityType.EnableDownloads);