From 6a56cd1b2c4d1df5de3206eac2e187d242381c2e Mon Sep 17 00:00:00 2001 From: Student Main Date: Wed, 8 Jan 2020 10:33:53 +0800 Subject: [PATCH] fix npe when first run --- shadowsocks-csharp/View/MenuViewController.cs | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/shadowsocks-csharp/View/MenuViewController.cs b/shadowsocks-csharp/View/MenuViewController.cs index 54174983..84e75246 100644 --- a/shadowsocks-csharp/View/MenuViewController.cs +++ b/shadowsocks-csharp/View/MenuViewController.cs @@ -22,7 +22,7 @@ namespace Shadowsocks.View // and it should just do anything related to the config form private ShadowsocksController controller; - private UpdateChecker updateChecker; + //private UpdateChecker updateChecker; private NotifyIcon _notifyIcon; private Icon icon, icon_in, icon_out, icon_both, previousIcon; @@ -89,10 +89,8 @@ namespace Shadowsocks.View UpdateTrayIconAndNotifyText(); _notifyIcon.Visible = true; _notifyIcon.ContextMenu = contextMenu1; - _notifyIcon.BalloonTipClicked += notifyIcon1_BalloonTipClicked; _notifyIcon.MouseClick += notifyIcon1_Click; _notifyIcon.MouseDoubleClick += notifyIcon1_DoubleClick; - _notifyIcon.BalloonTipClosed += _notifyIcon_BalloonTipClosed; controller.TrafficChanged += controller_TrafficChanged; LoadCurrentConfiguration(); @@ -381,27 +379,6 @@ namespace Shadowsocks.View ShowBalloonTip(I18N.GetString("Shadowsocks"), result, ToolTipIcon.Info, 1000); } - void notifyIcon1_BalloonTipClicked(object sender, EventArgs e) - { - if (updateChecker.NewVersionFound) - { - updateChecker.NewVersionFound = false; /* Reset the flag */ - if (System.IO.File.Exists(updateChecker.LatestVersionLocalName)) - { - string argument = "/select, \"" + updateChecker.LatestVersionLocalName + "\""; - System.Diagnostics.Process.Start("explorer.exe", argument); - } - } - } - - private void _notifyIcon_BalloonTipClosed(object sender, EventArgs e) - { - if (updateChecker.NewVersionFound) - { - updateChecker.NewVersionFound = false; /* Reset the flag */ - } - } - private void LoadCurrentConfiguration() { Configuration config = controller.GetConfigurationCopy();