1717// under the License.
1818// </copyright>
1919
20+ using System ;
2021using System . Text . Json ;
2122using System . Text . Json . Nodes ;
2223using System . Text . Json . Serialization ;
2324using System . Threading ;
2425
26+ #nullable enable
27+
2528namespace OpenQA . Selenium . DevTools
2629{
2730 /// <summary>
@@ -35,6 +38,7 @@ public class DevToolsCommandData
3538 /// <param name="commandId">The ID of the commmand execution.</param>
3639 /// <param name="commandName">The method name of the DevTools command.</param>
3740 /// <param name="commandParameters">The parameters of the DevTools command.</param>
41+ /// <exception cref="ArgumentNullException">If <paramref name="commandName"/> is <see langword="null"/>.</exception>
3842 public DevToolsCommandData ( long commandId , string commandName , JsonNode commandParameters )
3943 : this ( commandId , null , commandName , commandParameters )
4044 {
@@ -47,11 +51,12 @@ public DevToolsCommandData(long commandId, string commandName, JsonNode commandP
4751 /// <param name="sessionId">The session ID of the current command execution.</param>
4852 /// <param name="commandName">The method name of the DevTools command.</param>
4953 /// <param name="commandParameters">The parameters of the DevTools command.</param>
50- public DevToolsCommandData ( long commandId , string sessionId , string commandName , JsonNode commandParameters )
54+ /// <exception cref="ArgumentNullException">If <paramref name="commandName"/> is <see langword="null"/>.</exception>
55+ public DevToolsCommandData ( long commandId , string ? sessionId , string commandName , JsonNode commandParameters )
5156 {
5257 CommandId = commandId ;
5358 SessionId = sessionId ;
54- CommandName = commandName ;
59+ CommandName = commandName ?? throw new ArgumentNullException ( nameof ( commandName ) ) ;
5560 CommandParameters = commandParameters ;
5661 SyncEvent = new ManualResetEventSlim ( false ) ;
5762 }
@@ -61,7 +66,7 @@ public DevToolsCommandData(long commandId, string sessionId, string commandName,
6166 /// </summary>
6267 [ JsonPropertyName ( "sessionId" ) ]
6368 [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
64- public string SessionId { get ; }
69+ public string ? SessionId { get ; }
6570
6671 /// <summary>
6772 /// Gets the numeric ID of the command execution.
0 commit comments