From 18f448684ef05fa65f53bf7f8a817f480651d8de Mon Sep 17 00:00:00 2001 From: Student Main Date: Thu, 5 Dec 2019 11:33:29 +0800 Subject: [PATCH] null check for TranslateForm --- shadowsocks-csharp/Controller/I18N.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shadowsocks-csharp/Controller/I18N.cs b/shadowsocks-csharp/Controller/I18N.cs index 15861ae1..5b68a4e2 100755 --- a/shadowsocks-csharp/Controller/I18N.cs +++ b/shadowsocks-csharp/Controller/I18N.cs @@ -95,17 +95,21 @@ namespace Shadowsocks.Controller public static void TranslateForm(Form c) { + if (c == null) return; c.Text = GetString(c.Text); foreach (var item in ViewUtils.GetChildControls(c)) { + if (item == null) continue; item.Text = GetString(item.Text); } TranslateMenu(c.Menu); } public static void TranslateMenu(Menu m) { + if (m == null) return; foreach (var item in ViewUtils.GetMenuItems(m)) { + if (item == null) continue; item.Text = GetString(item.Text); } }