File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
ArduinoCore-Linux/cores/arduino Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -82,14 +82,16 @@ class EthernetClient : public Client {
8282 active_clients ().push_back (this );
8383 }
8484 EthernetClient (SocketImpl* sock, int bufferSize = 256 , long timeout = 2000 ) {
85- setTimeout (timeout);
86- this ->bufferSize = bufferSize;
87- readBuffer = RingBufferExt (bufferSize);
88- writeBuffer = RingBufferExt (bufferSize);
89- p_sock = sock;
90- is_connected = p_sock->connected ();
91- registerCleanup ();
92- active_clients ().push_back (this );
85+ if (sock) {
86+ setTimeout (timeout);
87+ this ->bufferSize = bufferSize;
88+ readBuffer = RingBufferExt (bufferSize);
89+ writeBuffer = RingBufferExt (bufferSize);
90+ p_sock = sock;
91+ is_connected = p_sock->connected ();
92+ registerCleanup ();
93+ active_clients ().push_back (this );
94+ }
9395 }
9496 EthernetClient (int socket) {
9597 setTimeout (2000 );
You can’t perform that action at this time.
0 commit comments