microsoft / microsoft/automatic-graph-layout

Null ref exception at GraphControlTest.MainPage in GraphControlSilverlight\GraphControlTest

Open
#30 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
1.5k
Forks
319
Avg merge
38m
Merged PRs (30d)
1

Description

at GraphControlTest of GraphContorlSilverlight.sln, at MainPage.xaml.cs, the following code

   private void LayoutGeometry_Click(object sender, RoutedEventArgs e)
    {
        var dgraph = FromGeometryContainer.Children[0] as DGraph;
        var dg = dgraph.Graph;
        GeometryTest.Layout(dg.GeometryGraph);
        dgraph.Invalidate();
    }

results in null ref exeption at "var dg = dgraph.Graph" because the "Children[0]" of the container is returning a Button, not a DGraph, so the "as DGraph" gives null

this error occurs at last page of that SL demo, by pressing Layout button at that tab (I see nothing in the graph display btw in that page)

have also tried first pressing the "Geometry Test" button which may be unrelated to that page though since it always appears at top-right, not only when you have that last tab page selected (not sure what that button does either)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in GraphControlSilverlight\GraphControlTest, especially MainPage.xaml.cs and LayoutGeometry_Click. Reproduce the failure on the last demo tab by pressing Layout, then inspect how FromGeometryContainer.Children is populated and why its first child is a Button. Done means the Layout action no longer raises the null-reference exception and the intended graph display behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.