Skip to content

Conversation

@trivalik
Copy link

@trivalik trivalik commented Dec 2, 2024

I just added in MinWpfApp at the end of MainWindow_Loaded:

            graphControl.Graph = null;
            graphControl.Graph = graph;

This lead to a NullReferenceException on reassingment. This is the fix for it.

@trivalik
Copy link
Author

trivalik commented Dec 2, 2024

@microsoft-github-policy-service agree

if (_drawingGraph == null) return;
if (_drawingGraph == null) {
ClearGraphViewer();
return;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just not sure whether GraphChanged/LayoutComplete events should still miss here. In case we do it, should we do also check for RunLayoutAsync?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be safer on assigning a null to create an empty graph and process it instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated it this way.

@levnach
Copy link
Contributor

levnach commented Dec 10, 2024

Msagl is in the middle of a major reshuffling. I am trying to retarget it to .net8.0, .net9.0. I will merge the pull request after the change.

@levnach
Copy link
Contributor

levnach commented Dec 14, 2024

I integrated the change.

@levnach levnach closed this Dec 14, 2024
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

Successfully merging this pull request may close these issues.

2 participants