From 92dc2cc54b5d78b88c4b911e1cbf9076a0df620c Mon Sep 17 00:00:00 2001 From: sta Date: Sun, 13 Aug 2017 15:49:56 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/WebSocket.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 83cfbf48..e522b1ce 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -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); }