Skip to content

Check if customEvents is null before accessing #28

@RobbyZ

Description

@RobbyZ

Thanks for this great resource :)

I found a small bug. I am checking events first before adding them to ensure I don't double-add a custom event. But if I do this, I'll get a null reference exception because customEvents is null until one is defined.

if (customEvents.ContainsKey(eventInfo))

I added a null check to this if:

if (customEvents != null && customEvents.ContainsKey(eventInfo))

But maybe would be better to just always define customEvents on init? If not, there may be some other places where customEvents is accessed without null check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions