- if (!ctf_fs->metadata->is_uuid_set) {
- memcpy(ctf_fs->metadata->uuid, header.uuid, sizeof(header.uuid));
- ctf_fs->metadata->is_uuid_set = true;
- } else if (bt_uuid_compare(header.uuid, ctf_fs->metadata->uuid)) {
- PERR("Metadata UUID mismatch between packets of the same file\n");
- goto error;
+ if (ctf_fs) {
+ if (!ctf_fs->metadata->is_uuid_set) {
+ memcpy(ctf_fs->metadata->uuid, header.uuid, sizeof(header.uuid));
+ ctf_fs->metadata->is_uuid_set = true;
+ } else if (bt_uuid_compare(header.uuid, ctf_fs->metadata->uuid)) {
+ PERR("Metadata UUID mismatch between packets of the same file\n");
+ goto error;
+ }