Browse Source

Prevents throw exception if Border is null.

BDisp 2 years ago
parent
commit
977f907cb4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Terminal.Gui/Core/Border.cs

+ 1 - 1
Terminal.Gui/Core/Border.cs

@@ -284,7 +284,7 @@ namespace Terminal.Gui {
 			/// <inheritdoc/>
 			/// <inheritdoc/>
 			public override void OnCanFocusChanged ()
 			public override void OnCanFocusChanged ()
 			{
 			{
-				if (Border.Child != null) {
+				if (Border?.Child != null) {
 					Border.Child.CanFocus = CanFocus;
 					Border.Child.CanFocus = CanFocus;
 				}
 				}
 				base.OnCanFocusChanged ();
 				base.OnCanFocusChanged ();