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

This commit is contained in:
kimw
2015-08-22 12:26:26 +08:00
parent b2c2d05c94
commit 3283c93857
@@ -414,7 +414,12 @@ namespace Shadowsocks.Controller
//UpdatePACFromGFWList(); // TODO: code like this temporary
//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))
{
string local = File.ReadAllText(PACServer.USER_RULE_FILE, Encoding.UTF8);