Skip to content

Commit a593de0

Browse files
author
falkTX
committed
Fix crash when saving state without a kit loaded
1 parent f6e1a21 commit a593de0

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

drmr.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -442,16 +442,18 @@ save_state(LV2_Handle instance,
442442
return LV2_STATE_ERR_NO_FEATURE;
443443
}
444444

445-
char* mapped_path = map_path->abstract_path(map_path->handle,
446-
drmr->current_path);
447-
448-
stat = store(handle,
449-
drmr->uris.kit_path,
450-
mapped_path,
451-
strlen(mapped_path) + 1,
452-
drmr->uris.string_urid,
453-
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
454-
if (stat) return stat;
445+
if (drmr->current_path != NULL) {
446+
char* mapped_path = map_path->abstract_path(map_path->handle,
447+
drmr->current_path);
448+
449+
stat = store(handle,
450+
drmr->uris.kit_path,
451+
mapped_path,
452+
strlen(mapped_path) + 1,
453+
drmr->uris.string_urid,
454+
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
455+
if (stat) return stat;
456+
}
455457

456458
flag = drmr->ignore_velocity?1:0;
457459
stat = store(handle,

0 commit comments

Comments
 (0)