Skip to content

Commit

Permalink
[dotnet] quit fails after not successful new session
Browse files Browse the repository at this point in the history
If new session creation fails a Quit() method is called which calls Dispose and then Quit command, unfortunately in this case
session is still not created and it throws null reference exception and this hides the actual exception
  • Loading branch information
Indomitable committed Jul 9, 2024
1 parent df75c3a commit 6b65af8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dotnet/src/webdriver/WebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,10 @@ protected virtual void Dispose(bool disposing)
{
try
{
this.Execute(DriverCommand.Quit, null);
if (this.sessionId is not null)
{
this.Execute(DriverCommand.Quit, null);
}
}
catch (NotImplementedException)
{
Expand Down

0 comments on commit 6b65af8

Please sign in to comment.