summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shared-bindings/rgbmatrix/RGBMatrix.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c
index e4683af92..6a99e1f3d 100644
--- a/shared-bindings/rgbmatrix/RGBMatrix.c
+++ b/shared-bindings/rgbmatrix/RGBMatrix.c
@@ -210,6 +210,10 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n
}
}
+ if (args[ARG_width] <= 0) {
+ mp_raise_ValueError(translate("width must be greater than zero"));
+ }
+
preflight_pins_or_throw(clock_pin, rgb_pins, rgb_count, true);
mp_obj_t framebuffer = args[ARG_framebuffer].u_obj;