From 3283c93857c791ee41f1e187157dea86ecf77968 Mon Sep 17 00:00:00 2001 From: kimw <1@kimwong.me> Date: Sat, 22 Aug 2015 12:26:26 +0800 Subject: [PATCH] fix: auto detected `user-rule.txt`'s change while no `gfwlist.txt` file, the application crashs. --- shadowsocks-csharp/Controller/ShadowsocksController.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shadowsocks-csharp/Controller/ShadowsocksController.cs b/shadowsocks-csharp/Controller/ShadowsocksController.cs index 87496199..263852a0 100755 --- a/shadowsocks-csharp/Controller/ShadowsocksController.cs +++ b/shadowsocks-csharp/Controller/ShadowsocksController.cs @@ -414,7 +414,12 @@ namespace Shadowsocks.Controller //UpdatePACFromGFWList(); // TODO: code like this temporary //try //{ - List lines = GFWListUpdater.ParseResult(File.ReadAllText(Utils.GetTempPath() + "\\gfwlist.txt")); + if (!File.Exists(Utils.GetTempPath() + "\\gfwlist.txt")) + { + UpdatePACFromGFWList(); + return; + } + List lines = GFWListUpdater.ParseResult(File.ReadAllText(Utils.GetTempPath() + "\\gfwlist.txt")); if (File.Exists(PACServer.USER_RULE_FILE)) { string local = File.ReadAllText(PACServer.USER_RULE_FILE, Encoding.UTF8);