Browse Source

fix: auto detected `user-rule.txt`'s change while no `gfwlist.txt` file, the application crashs.

tags/3.0
kimw 9 years ago
parent
commit
3283c93857
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      shadowsocks-csharp/Controller/ShadowsocksController.cs

+ 6
- 1
shadowsocks-csharp/Controller/ShadowsocksController.cs View File

@@ -414,7 +414,12 @@ namespace Shadowsocks.Controller
//UpdatePACFromGFWList(); // TODO: code like this temporary //UpdatePACFromGFWList(); // TODO: code like this temporary
//try //try
//{ //{
List<string> lines = GFWListUpdater.ParseResult(File.ReadAllText(Utils.GetTempPath() + "\\gfwlist.txt"));
if (!File.Exists(Utils.GetTempPath() + "\\gfwlist.txt"))
{
UpdatePACFromGFWList();
return;
}
List<string> lines = GFWListUpdater.ParseResult(File.ReadAllText(Utils.GetTempPath() + "\\gfwlist.txt"));
if (File.Exists(PACServer.USER_RULE_FILE)) if (File.Exists(PACServer.USER_RULE_FILE))
{ {
string local = File.ReadAllText(PACServer.USER_RULE_FILE, Encoding.UTF8); string local = File.ReadAllText(PACServer.USER_RULE_FILE, Encoding.UTF8);


Loading…
Cancel
Save