From 73e6405b3f20096769284b830324e0f5ae134346 Mon Sep 17 00:00:00 2001 From: David Burns Date: Thu, 5 Mar 2020 10:14:58 +0000 Subject: [PATCH] Perform null check when calling Start on DriverService (#8083) * Perform null check when calling Start on DriverService * Updates documentation Co-authored-by: David Burns --- dotnet/src/webdriver/DriverService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dotnet/src/webdriver/DriverService.cs b/dotnet/src/webdriver/DriverService.cs index 08c3468b78d58..fb39a3397b4cd 100644 --- a/dotnet/src/webdriver/DriverService.cs +++ b/dotnet/src/webdriver/DriverService.cs @@ -250,11 +250,14 @@ public void Dispose() } /// - /// Starts the DriverService. + /// Starts the DriverService if it is not already running. /// [SecurityPermission(SecurityAction.Demand)] public void Start() { + if(this.driverServiceProcess != null) + return; + this.driverServiceProcess = new Process(); this.driverServiceProcess.StartInfo.FileName = Path.Combine(this.driverServicePath, this.driverServiceExecutableName); this.driverServiceProcess.StartInfo.Arguments = this.CommandLineArguments;