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

NullReferenceException when removing DrawNewLinkBehavior #420

Open
GeertvanHorrik opened this issue Feb 29, 2024 · 1 comment
Open

NullReferenceException when removing DrawNewLinkBehavior #420

GeertvanHorrik opened this issue Feb 29, 2024 · 1 comment

Comments

@GeertvanHorrik
Copy link

I was getting NullReferenceExceptions when updating to the new 3.x version. After some debugging, I noticed the ignoring of potentially nullable value:

https://github.com/Blazor-Diagrams/Blazor.Diagrams/blob/develop/src/Blazor.Diagrams/Components/LinkWidget.razor#L18

Since the behavior can be removed, the null check should still exist?

For now I disabled this call on new diagrams:

diagram.UnregisterBehavior<DragNewLinkBehavior>();
@vbalestone
Copy link

I had the same exception by removing DrawNewLinkBehavior and registering a derived class from it.
I solved the issue by changing the GetBehavior function to check if has a derived class if the asked is not found.

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

2 participants