Skip to content

Minor enhancement to avoid null exceptions. #1533

Description

@kzu

Discussed in https://github.com/devlooped/moq/discussions/1529

Originally posted by iPazooki February 6, 2025
In the AwaitableFactory.cs file, the TryGet method may return null, which is not considered good practice. To address this issue and prevent potential null reference exceptions, I recommend changing the return type to IAwaitableFactory?. This indicates that the return value can be nullable, alerting developers that they need to handle this scenario appropriately. Subsequently, we need to change five more places because of this change which is not a big deal.

Back this issue
Back this issue

Activity

  1. ndwpatrick commented on Feb 27, 2025

    @ndwpatrick

    Hi @kzu I'm interested in working on this issue. Can I take it? Also, could you provide any additional details if needed?

  2. kzu commented on Mar 7, 2025

    @kzu
    MemberAuthor

    Hi @ndwpatrick. Help is very much appreciated!

  3. ndwpatrick commented on Mar 10, 2025

    @ndwpatrick

    @kzu Can you please assign this issue to me so that I can start working on it.

  4. assigned and unassigned on Mar 10, 2025
  5. kzu commented on Mar 10, 2025

    @kzu
    MemberAuthor

    Done!

  6. ShirAvneri commented on Apr 25, 2025

    @ShirAvneri
    Contributor

    Hi @ndwpatrick , are you working on this issue?
    Can I maybe take over?

  7. ShirAvneri commented on May 10, 2025

    @ShirAvneri
    Contributor

    Hi @kzu , it seems this issue is not being worked on.
    Could I take over?

  8. kzu commented on May 10, 2025

    @kzu
    MemberAuthor

    Sure thing! Assigning to you

  9. locked and limited conversation to collaborators on Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions