File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 2020using OpenQA . Selenium . Internal ;
2121using System ;
2222using System . Collections . Generic ;
23+ using System . Diagnostics . CodeAnalysis ;
2324using System . Globalization ;
2425using System . Text . Json ;
2526using System . Text . Json . Serialization ;
@@ -215,6 +216,21 @@ public string ToJson()
215216 return JsonSerializer . Serialize ( this ) ;
216217 }
217218
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+
218234 /// <summary>
219235 /// Returns the object as a string.
220236 /// </summary>
You can’t perform that action at this time.
0 commit comments