diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c index a6b71b380a6..b9752d56113 100644 --- a/usr.sbin/sade/label.c +++ b/usr.sbin/sade/label.c @@ -1034,7 +1034,8 @@ diskLabel(Device *dev) break; case 'T': /* Toggle newfs state */ - if (label_chunk_info[here].type == PART_FILESYSTEM) { + if ((label_chunk_info[here].type == PART_FILESYSTEM) && + (label_chunk_info[here].c->private_data)) { PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private_data); if (!pi->newfs) label_chunk_info[here].c->flags |= CHUNK_NEWFS; diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c index a6b71b380a6..b9752d56113 100644 --- a/usr.sbin/sysinstall/label.c +++ b/usr.sbin/sysinstall/label.c @@ -1034,7 +1034,8 @@ diskLabel(Device *dev) break; case 'T': /* Toggle newfs state */ - if (label_chunk_info[here].type == PART_FILESYSTEM) { + if ((label_chunk_info[here].type == PART_FILESYSTEM) && + (label_chunk_info[here].c->private_data)) { PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private_data); if (!pi->newfs) label_chunk_info[here].c->flags |= CHUNK_NEWFS;