Skip to content

BaseExtEvent._persistentListeners is null unless serialized #8

Description

@harald921

Issue: The array "_persistentListeners" is null unless serialized. This causes a NullReferenceException in events that have been added during runtime specifically the use of DynamicListeners.

Steps to reproduce:

  • Create a new MonoBehaviour named "Test" with a serialized ExtEvent "TestEvent"
  • Put "Test" on a prefab
  • Instantiate prefab
  • Try and invoke TestEvent in any way (With or without DynamicListeners having any listeners)

Solution: Create a new empty array in the constructor

(Off topic side note: Thank you so much for creating this plugin, it's amazing)

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