Bug 48875

Summary: Socket.AddSockets throw exception with weird param
Product: [Mono] Class Libraries Reporter: su21 <sillyousu>
Component: SystemAssignee: Bugzilla <bugzilla>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono, sillyousu
Priority: ---    
Version: 4.6.0 (C8)   
Target Milestone: Untriaged   
Hardware: PC   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:

Description su21 2016-12-03 14:53:43 UTC
mono-mono-4.6.2.7/mcs/class/System/System.Net.Sockets/Socket.cs


```
                static void AddSockets (List<Socket> sockets, IList list, string name)
                {
                        if (list != null) {
                                foreach (Socket sock in list) {
                                        if (sock == null) // MS throws a NullRef
                                                throw new ArgumentNullException ("name", "Contains a null element");
                                        sockets.Add (sock);
                                }
                        }

                        sockets.Add (null);
                }
```

it should be  `throw new ArgumentNullException (name, "Contains a null element");`,  right ?
Comment 1 su21 2016-12-03 15:25:53 UTC
https://github.com/mono/mono/pull/4086