From 76e74741e0b3c5078bef7831d9f69d60770eb723 Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 16 Aug 2017 13:39:13 +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 4be23b2e..2bd47630 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -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); }