Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Don't throw an exception from TzConvert.TryGetTimeZone if the time zone id string is null. #154

Open
scotthannen opened this issue Apr 26, 2024 Discussed in #153 · 0 comments

Comments

@scotthannen
Copy link

scotthannen commented Apr 26, 2024

Discussed in #153

Originally posted by scotthannen April 26, 2024
I have never contributed to open source. Can I submit this as a PR with the accompanying unit test? I don't know the rules. Do I need a specific branch name?

    public static bool TryGetTimeZoneInfo(string windowsOrIanaTimeZoneId,
        [MaybeNullWhen(false)] out TimeZoneInfo timeZoneInfo)
    {
        if (windowsOrIanaTimeZoneId is null)      // <==== THIS
        {
            timeZoneInfo = null;
            return false;
        }
        // etc
    }
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

No branches or pull requests

1 participant