2

Closed

A NullReferenceException is thrown on only some snooped WPF windows in Snoop.VisualTreeItem.Reload()

description

Occasionally and it appears as if only on certain WPF screens, Snoop will throw a NullReferenceException deep in a recursive Snoop.VisualTreeItem.Reload() call stack.
Closed May 17, 2013 at 10:18 PM by cplotts

comments

codekaizen wrote Nov 26, 2012 at 11:20 PM

The problem is on the following line (182) of Snoop.VisualTreeItem:
this.name = (this.target is FrameworkElement) ? ((FrameworkElement)this.target).Name : string.Empty;

this.nameLower = this.name.ToLower();
Specifically, ((FrameworkElement)this.target).Name is null, and the .ToLower() fails.

codekaizen wrote Nov 27, 2012 at 12:16 AM

Added a pull request on github which fixes this issue.

maciekrakowski wrote Nov 27, 2012 at 3:42 AM

Hi codekaizen,

Thank you for your contribution, and for your due diligence in troubleshooting the issue. We always appreciate people doing this. We will probably take your pull request in the next release of Snoop.
  • Maciek

cplotts wrote May 17, 2013 at 10:20 PM

This was fixed by merging the GitHub pull request.

This was fixed with commit 7a79dbb7941c.