stm32/modnetwork: Don't call NIC callback if it's NULL.

This commit is contained in:
Damien George 2019-02-22 22:25:06 +11:00
parent 08a24c5f41
commit ac3e2f380d

View File

@ -57,7 +57,9 @@ STATIC void pyb_lwip_poll(void) {
for (struct netif *netif = netif_list; netif != NULL; netif = netif->next) { for (struct netif *netif = netif_list; netif != NULL; netif = netif->next) {
if (netif->flags & NETIF_FLAG_LINK_UP) { if (netif->flags & NETIF_FLAG_LINK_UP) {
mod_network_nic_type_t *nic = netif->state; mod_network_nic_type_t *nic = netif->state;
nic->poll_callback(nic, netif); if (nic->poll_callback) {
nic->poll_callback(nic, netif);
}
} }
} }
// Run the lwIP internal updates // Run the lwIP internal updates