Permalink
Browse files

Replace SharpTreeNodeView InvalidOperationException with debug message.

  • Loading branch information...
dgrunwald committed Mar 17, 2018
1 parent 80d3deb commit 795d580004d658b73ee374b4ad97279ec96f826a
Showing with 5 additions and 2 deletions.
  1. +5 −2 SharpTreeView/SharpTreeNodeView.cs
@@ -7,6 +7,7 @@
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using System.ComponentModel;
using System.Diagnostics;
namespace ICSharpCode.TreeView
{
@@ -145,8 +146,10 @@ internal double CalculateIndent()
else {
result -= 19;
}
if (result < 0)
throw new InvalidOperationException();
if (result < 0) {
Debug.WriteLine("SharpTreeNodeView.CalculateIndent() on node without correctly-set level");
return 0;
}
return result;
}
}

0 comments on commit 795d580

Please sign in to comment.