Merge pull request #7947 from FoamyGuy/polygon_point_typecheck

validate point type is tuple in vectorio Polygon
This commit is contained in:
Scott Shawcroft 2023-05-09 09:12:17 -07:00 committed by GitHub
commit f8cbdf88e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -36,6 +36,7 @@ static void _clobber_points_list(vectorio_polygon_t *self, mp_obj_t points_tuple
for (uint16_t i = 0; i < len; ++i) {
size_t tuple_len = 0;
mp_obj_t *tuple_items;
mp_arg_validate_type(items[i], &mp_type_tuple, MP_QSTR_point);
mp_obj_tuple_get(items[i], &tuple_len, &tuple_items);
mp_arg_validate_length(tuple_len, 2, MP_QSTR_point);