File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 20
20
using OpenQA . Selenium . Internal ;
21
21
using System ;
22
22
using System . Collections . Generic ;
23
+ using System . Diagnostics . CodeAnalysis ;
23
24
using System . Globalization ;
24
25
using System . Text . Json ;
25
26
using System . Text . Json . Serialization ;
@@ -215,6 +216,21 @@ public string ToJson()
215
216
return JsonSerializer . Serialize ( this ) ;
216
217
}
217
218
219
+ /// <summary>
220
+ /// Throws if <see cref="Value"/> is <see langword="null"/>.
221
+ /// </summary>
222
+ /// <exception cref="WebDriverException">If <see cref="Value"/> is <see langword="null"/>.</exception>
223
+ [ MemberNotNull ( nameof ( Value ) ) ]
224
+ internal Response EnsureValueIsNotNull ( )
225
+ {
226
+ if ( Value is null )
227
+ {
228
+ throw new WebDriverException ( "Response from remote end doesn't have $.Value property" ) ;
229
+ }
230
+
231
+ return this ;
232
+ }
233
+
218
234
/// <summary>
219
235
/// Returns the object as a string.
220
236
/// </summary>
You can’t perform that action at this time.
0 commit comments