diff --git a/src/lang.zig b/src/lang.zig index a455a1f..89ed749 100644 --- a/src/lang.zig +++ b/src/lang.zig @@ -362,9 +362,14 @@ pub const Command = struct { t4d: f32, t4a_db: f32, }); - pub const Moddelay = LV2Command(.moddelay, "http://plugin.org.uk/swh-plugins/modDelay", struct { - base: f32, - }); + + pub const Moddelay = LV2Command( + .moddelay, + "http://plugin.org.uk/swh-plugins/modDelay", + struct { + base: f32, + }, + ); pub const Multichorus = LV2Command(.multichorus, "http://calf.sourceforge.net/plugins/MultiChorus", struct { min_delay: f32, @@ -471,8 +476,20 @@ pub const Lang = struct { // arguments... if (is_lv2_command) { - cmd.split = try std.fmt.parseInt(usize, tok_it.next().?, 10); - cmd.index = try std.fmt.parseInt(usize, tok_it.next().?, 10); + const split = tok_it.next(); + if (split == null) { + self.doError("Expected split parameter, got EOL", .{}); + return; + } + + const index = tok_it.next(); + if (index == null) { + self.doError("Expected index parameter, got EOL", .{}); + return; + } + + cmd.split = try std.fmt.parseInt(usize, split.?, 10); + cmd.index = try std.fmt.parseInt(usize, index.?, 10); inline for (@typeInfo(@TypeOf(cmd.parameters)).Struct.fields) |cmd_field| { const arg = tok_it.next().?;