Add `NULL` check in `sg_compact()`; fix #4139

parent 82e00ce6
......@@ -226,12 +226,14 @@ sg_index(mrb_state *mrb, seglist *t)
static void
sg_compact(mrb_state *mrb, seglist *t)
{
segment *seg = t->rootseg;
segment *seg;
mrb_int i;
segment *seg2 = NULL;
mrb_int i2;
mrb_int size = 0;
if (t == NULL) return;
seg = t->rootseg;
if (t->index && (size_t)t->size == t->index->size) {
sg_index(mrb, t);
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment