From e111cc2ee2dab159c73302b4e5ed1381ecf3c901 Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 22 Apr 2019 14:15:17 +0900 Subject: [PATCH] [Modify] Throw an exception if read-only --- websocket-sharp/Net/CookieCollection.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/websocket-sharp/Net/CookieCollection.cs b/websocket-sharp/Net/CookieCollection.cs index 8f91063a..cd454d31 100644 --- a/websocket-sharp/Net/CookieCollection.cs +++ b/websocket-sharp/Net/CookieCollection.cs @@ -628,11 +628,19 @@ namespace WebSocketSharp.Net /// /// A that contains the cookies to add. /// + /// + /// The collection is read-only. + /// /// /// is . /// public void Add (CookieCollection cookies) { + if (_readOnly) { + var msg = "The collection is read-only."; + throw new InvalidOperationException (msg); + } + if (cookies == null) throw new ArgumentNullException ("cookies");