Skip to content

Commit 44253d2

Browse files
committed
Use other style
1 parent 9a76e89 commit 44253d2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

dotnet/src/webdriver/Response.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using OpenQA.Selenium.Internal;
2121
using System;
2222
using System.Collections.Generic;
23+
using System.Diagnostics.CodeAnalysis;
2324
using System.Globalization;
2425
using System.Text.Json;
2526
using System.Text.Json.Serialization;
@@ -216,13 +217,16 @@ public string ToJson()
216217
}
217218

218219
/// <summary>
219-
/// Gets the <see cref="Value"/> of this response, or throws if it is <see langword="null"/>.
220+
/// Throws if <see cref="Value"/> is <see langword="null"/>.
220221
/// </summary>
221-
/// <returns>The <see cref="Value"/> instance.</returns>
222222
/// <exception cref="WebDriverException">If <see cref="Value"/> is <see langword="null"/>.</exception>
223-
internal object GetNotNullValue()
223+
[MemberNotNull(nameof(Value))]
224+
internal void ThrowIfValueNull()
224225
{
225-
return Value ?? throw new WebDriverException("Expected not-null response");
226+
if (Value is null)
227+
{
228+
throw new WebDriverException("Expected not-null response");
229+
}
226230
}
227231

228232
/// <summary>

0 commit comments

Comments
 (0)