From 449e38c239b74375e7468683bb50ccd01f535f92 Mon Sep 17 00:00:00 2001 From: sta Date: Sun, 21 Apr 2019 17:47:05 +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 5e73aeba..8f91063a 100644 --- a/websocket-sharp/Net/CookieCollection.cs +++ b/websocket-sharp/Net/CookieCollection.cs @@ -603,11 +603,19 @@ namespace WebSocketSharp.Net /// /// A to add. /// + /// + /// The collection is read-only. + /// /// /// is . /// public void Add (Cookie cookie) { + if (_readOnly) { + var msg = "The collection is read-only."; + throw new InvalidOperationException (msg); + } + if (cookie == null) throw new ArgumentNullException ("cookie");