From a56ababd8bf2f0a5952e69addf007fba09509e09 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 5 Aug 2007 16:47:07 +0000 Subject: [PATCH] Corrected NRE in WindowInfo.ToString functions, when referring to non-existent parent. --- Source/OpenTK/Platform/Windows/WindowInfo.cs | 2 +- Source/OpenTK/Platform/X11/WindowInfo.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/OpenTK/Platform/Windows/WindowInfo.cs b/Source/OpenTK/Platform/Windows/WindowInfo.cs index 21b800c8..b8ea7130 100644 --- a/Source/OpenTK/Platform/Windows/WindowInfo.cs +++ b/Source/OpenTK/Platform/Windows/WindowInfo.cs @@ -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"); } } diff --git a/Source/OpenTK/Platform/X11/WindowInfo.cs b/Source/OpenTK/Platform/X11/WindowInfo.cs index 39ae7b46..792d65ba 100644 --- a/Source/OpenTK/Platform/X11/WindowInfo.cs +++ b/Source/OpenTK/Platform/X11/WindowInfo.cs @@ -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"); } } }