Browse Source

Fix LogForm error after deleted log file

tags/4.1.9.3
celeron533 5 years ago
parent
commit
a03e9a5b0a
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      shadowsocks-csharp/View/LogForm.cs

+ 2
- 2
shadowsocks-csharp/View/LogForm.cs View File

@@ -175,7 +175,7 @@ namespace Shadowsocks.View
private void InitContent()
{
if (string.IsNullOrEmpty(filename))
if (string.IsNullOrEmpty(filename) || !File.Exists(filename))
return;
using (StreamReader reader = new StreamReader(new FileStream(filename,
FileMode.Open, FileAccess.Read, FileShare.ReadWrite)))
@@ -203,7 +203,7 @@ namespace Shadowsocks.View
this.Text = I18N.GetString("Log Viewer") +
$" [in: {Utils.FormatBytes(controller.InboundCounter)}, out: {Utils.FormatBytes(controller.OutboundCounter)}]";
if (string.IsNullOrEmpty(filename))
if (string.IsNullOrEmpty(filename) || !File.Exists(filename))
return;
try
{


Loading…
Cancel
Save