[Modify] Polish it

This commit is contained in:
sta 2017-08-16 13:39:13 +09:00
parent 998702e56d
commit 76e74741e0

View File

@ -3342,12 +3342,16 @@ namespace WebSocketSharp
if (fileInfo == null)
throw new ArgumentNullException ("fileInfo");
if (!fileInfo.Exists)
throw new ArgumentException ("The file does not exist.", "fileInfo");
if (!fileInfo.Exists) {
var msg = "The file does not exist.";
throw new ArgumentException (msg, "fileInfo");
}
FileStream stream;
if (!fileInfo.TryOpenRead (out stream))
throw new ArgumentException ("The file could not be opened.", "fileInfo");
if (!fileInfo.TryOpenRead (out stream)) {
var msg = "The file could not be opened.";
throw new ArgumentException (msg, "fileInfo");
}
sendAsync (Opcode.Binary, stream, completed);
}