Corrected NRE in WindowInfo.ToString functions, when referring to non-existent parent.

This commit is contained in:
the_fiddler 2007-08-05 16:47:07 +00:00
parent a987a5daf6
commit a56ababd8b
2 changed files with 2 additions and 2 deletions

View file

@ -32,7 +32,7 @@ namespace OpenTK.Platform.Windows
public override string ToString()
{
return String.Format("Windows.WindowInfo: Handle {0}{1} Parent {2}",
this.Handle, System.Environment.NewLine, this.Parent.ToString());
this.Handle, System.Environment.NewLine, this.Parent != null ? this.Parent.ToString() : "null");
}
}

View file

@ -35,7 +35,7 @@ namespace OpenTK.Platform.X11
public override string ToString()
{
return String.Format("X11.WindowInfo: Display {0}, Screen {1}, Handle {2}{3} Parent {4}",
this.Display, this.Screen, this.Handle, System.Environment.NewLine, this.Parent.ToString());
this.Display, this.Screen, this.Handle, System.Environment.NewLine, this.Parent != null ? this.Parent.ToString() : "null");
}
}
}