[Modify] Polish it

This commit is contained in:
sta 2017-08-13 15:49:56 +09:00
parent 59f93c7134
commit 92dc2cc54b

View File

@ -3131,12 +3131,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");
}
send (Opcode.Binary, stream);
}