Browse Source

Fixed code that was dependent on ToString behavior vs. direct test for null

Tig Kindel 1 year ago
parent
commit
25272378a0
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Terminal.Gui/View/Layout/PosDim.cs

+ 3 - 1
Terminal.Gui/View/Layout/PosDim.cs

@@ -446,7 +446,9 @@ public class Pos {
 				tside = "unknown";
 				break;
 			}
-			// Note: We do not checkt `Target` for null here to intentionally throw if so
+			if (Target == null) {
+				throw new NullReferenceException (nameof (Target));
+			}
 			return $"View(side={tside},target={Target})";
 		}