[Modify] Polish it

This commit is contained in:
sta 2019-11-22 22:07:49 +09:00
parent 6d85802bda
commit bd8b7b246a

View File

@ -264,9 +264,15 @@ namespace WebSocketSharp.Net
} }
set { set {
if (value != null && value.State != HttpHeaderType.Response) if (value == null) {
throw new InvalidOperationException ( _headers = null;
"The specified headers aren't valid for a response."); return;
}
if (value.State != HttpHeaderType.Response) {
var msg = "The value is not valid for a response.";
throw new InvalidOperationException (msg);
}
_headers = value; _headers = value;
} }