summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-02-22 22:25:06 +1100
committerDamien George <damien.p.george@gmail.com>2019-02-26 23:32:19 +1100
commitac3e2f380df95cf48228f2314b8d0bcd76855f50 (patch)
tree878c44672be8c440aae714aac98d64a7d83c33a4
parent08a24c5f41adab401e51c3b8c4886d8fa91d256f (diff)
stm32/modnetwork: Don't call NIC callback if it's NULL.
-rw-r--r--ports/stm32/modnetwork.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ports/stm32/modnetwork.c b/ports/stm32/modnetwork.c
index 0a0cd0e4a..ea43f7557 100644
--- a/ports/stm32/modnetwork.c
+++ b/ports/stm32/modnetwork.c
@@ -57,7 +57,9 @@ STATIC void pyb_lwip_poll(void) {
for (struct netif *netif = netif_list; netif != NULL; netif = netif->next) {
if (netif->flags & NETIF_FLAG_LINK_UP) {
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