Skip to content

Commit 5746209

Browse files
committed
return None instead of NULL for framebuffer and epaper
1 parent 42f1d50 commit 5746209

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

shared-module/displayio/EPaperDisplay.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ uint16_t common_hal_displayio_epaperdisplay_get_rotation(displayio_epaperdisplay
247247
}
248248

249249
mp_obj_t common_hal_displayio_epaperdisplay_get_root_group(displayio_epaperdisplay_obj_t *self) {
250+
if (self->core.current_group == NULL) {
251+
return mp_const_none;
252+
}
250253
return self->core.current_group;
251254
}
252255

shared-module/framebufferio/FramebufferDisplay.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,9 @@ void framebufferio_framebufferdisplay_reset(framebufferio_framebufferdisplay_obj
363363
}
364364

365365
mp_obj_t common_hal_framebufferio_framebufferdisplay_get_root_group(framebufferio_framebufferdisplay_obj_t *self) {
366+
if (self->core.current_group == NULL) {
367+
return mp_const_none;
368+
}
366369
return self->core.current_group;
367370
}
368371

0 commit comments

Comments
 (0)