From 654c648ec8c711cbb6ef20108365e8e6e84d2f0d Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 9 Jun 2017 16:06:35 +0900 Subject: [PATCH] [Modify] It throws exceptions --- websocket-sharp/Server/HttpServer.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/websocket-sharp/Server/HttpServer.cs b/websocket-sharp/Server/HttpServer.cs index 6faffe3a..24991f3b 100644 --- a/websocket-sharp/Server/HttpServer.cs +++ b/websocket-sharp/Server/HttpServer.cs @@ -1311,8 +1311,20 @@ namespace WebSocketSharp.Server /// /// A that represents the virtual path to the file to find. /// + /// + /// is . + /// + /// + /// is an empty string. + /// public byte[] GetFile (string path) { + if (path == null) + throw new ArgumentNullException ("path"); + + if (path.Length == 0) + throw new ArgumentException ("An empty string.", "path"); + path = RootPath + path; if (_windows) path = path.Replace ("/", "\\");