[Modify] Add a check

To determine if the file exists.
This commit is contained in:
sta 2016-11-25 16:38:51 +09:00
parent 2d54e45a46
commit 747fc0557e

View File

@ -2835,6 +2835,9 @@ namespace WebSocketSharp
if (file == null)
throw new ArgumentNullException ("file");
if (!file.Exists)
throw new ArgumentException ("The file does not exist.", "file");
FileStream stream;
if (!file.TryOpenRead (out stream))
throw new ArgumentException ("Cannot be opened to read.", "file");