Skip to content

Commit c4c204c

Browse files
committed
Ethernet: add nullptr check on returned network interface
1 parent f542aea commit c4c204c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/SocketWrapper/Ethernet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class EthernetClass: public NetworkInterface
4848
if (device_is_ready(dev)) {
4949
for (int i = 1; i < 4; i++) {
5050
auto _if = net_if_get_by_index(i);
51-
if (!net_eth_type_is_wifi(_if)) {
51+
if (_if && !net_eth_type_is_wifi(_if)) {
5252
netif = _if;
5353
break;
5454
}

0 commit comments

Comments
 (0)