Skip to content

Commit 0d4fdc5

Browse files
committed
Replace null suppress with exception
1 parent ed41246 commit 0d4fdc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dotnet/src/webdriver/Firefox/FirefoxDriverService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public static FirefoxDriverService CreateDefaultService(string driverPath)
200200
if (File.Exists(driverPath))
201201
{
202202
fileName = Path.GetFileName(driverPath);
203-
driverPath = Path.GetDirectoryName(driverPath)!;
203+
driverPath = Path.GetDirectoryName(driverPath) ?? throw new ArgumentException("Driver file exists but parent directory is unreachable", nameof(driverPath));
204204
}
205205
else
206206
{

0 commit comments

Comments
 (0)