[Modify] Add a check

To determine if the file exists.
This commit is contained in:
sta 2016-11-24 16:53:12 +09:00
parent cf2eb179c1
commit e8d2eab0cf

View File

@ -2718,6 +2718,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");