From 5c7c3e171b21674e2d2af67b2eccc9d7a237dc01 Mon Sep 17 00:00:00 2001 From: sta Date: Thu, 27 Jan 2022 21:17:01 +0900 Subject: [PATCH] [Modify] Add a null check --- Example2/Chat.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Example2/Chat.cs b/Example2/Chat.cs index 940830b6..2391bf31 100644 --- a/Example2/Chat.cs +++ b/Example2/Chat.cs @@ -40,6 +40,9 @@ namespace Example2 protected override void OnClose (CloseEventArgs e) { + if (_name == null) + return; + var fmt = "{0} got logged off..."; var msg = String.Format (fmt, _name);