Skip to content

Conversation

@mxschmitt
Copy link
Contributor

@mxschmitt mxschmitt commented May 21, 2025

Patch one of many for enabling strict null checks in our code-base.

Relates #3163

@mxschmitt mxschmitt force-pushed the enable-nullable-1 branch from 06eb101 to fa3da57 Compare May 22, 2025 00:01
@mxschmitt mxschmitt force-pushed the enable-nullable-1 branch from fa3da57 to 9d9cc26 Compare May 22, 2025 00:04
internal static string? ToWebSocketBaseURL(string? baseURL)
{
if (string.IsNullOrEmpty(baseURL))
if (string.IsNullOrEmpty(baseURL) || baseURL == null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't IsNullOrEmpty() handle the null case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately not with our tfm: https://stackoverflow.com/a/64066801

Co-authored-by: Dmitry Gozman <dgozman@gmail.com>

[MethodImpl(MethodImplOptions.NoInlining)]
public async Task<IBrowser> LaunchAsync(BrowserTypeLaunchOptions options = default)
public async Task<IBrowser> LaunchAsync(BrowserTypeLaunchOptions? options = default)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this break older version .net users? Or do we not care about that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the public interface, the public interface is this which is nullable.

@mxschmitt mxschmitt merged commit 70f3aa3 into main May 22, 2025
15 checks passed
@mxschmitt mxschmitt deleted the enable-nullable-1 branch May 22, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants