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 ("/", "\\");