Skip to content
This repository was archived by the owner on May 9, 2025. It is now read-only.
This repository was archived by the owner on May 9, 2025. It is now read-only.

SetValue to null causes NullPointerException #162

Description

@Haytam95

Hi, if I try to cleanup a Variable by setting null value, it raises NullPointerException.

I've fixed this issue changing in BaseVariable.cs:

 public override T SetValue(T value)
{
            T oldValue = _value;
            T newValue = base.SetValue(value);


            if(newValue != null && !newValue.Equals(oldValue)) // <---- This, null check
            {
                _event.Invoke(newValue);
            }

            return newValue;
}

Maybe it could be added to the code? :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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