esp32/machine_pin: Fix null pointer access in machine_pin_find.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
pull/12420/head
iabdalkader 2023-09-11 16:17:43 +02:00 zatwierdzone przez Damien George
rodzic 92f379cce4
commit 7087880ce9
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -113,7 +113,7 @@ STATIC const machine_pin_obj_t *machine_pin_find(mp_obj_t pin_in) {
// Try to find the pin in the board pins dict.
if (mp_obj_is_str(pin_in)) {
const machine_pin_obj_t *self = machine_pin_find_named(&machine_pin_board_pins_locals_dict, pin_in);
if (self->base.type != NULL) {
if (self && self->base.type != NULL) {
return self;
}
}