1 parent 0c59db1 commit e5a15cbCopy full SHA for e5a15cb
1 file changed
py/objlist.c
@@ -435,8 +435,10 @@ static mp_obj_list_t *list_new(uint n) {
435
436
mp_obj_t mp_obj_new_list(uint n, mp_obj_t *items) {
437
mp_obj_list_t *o = list_new(n);
438
- for (int i = 0; i < n; i++) {
439
- o->items[i] = items[i];
+ if (items != NULL) {
+ for (int i = 0; i < n; i++) {
440
+ o->items[i] = items[i];
441
+ }
442
}
443
return o;
444
0 commit comments