Skip to content

Commit

Permalink
don't try to save invalid command presets
Browse files Browse the repository at this point in the history
  • Loading branch information
darylc committed Jan 28, 2024
1 parent ab78884 commit 169353b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion www/commandPresets.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ function SaveCommands()
} else if ((cmd.name == '') && (cmd.command !='')) {
errors.push(`${cmd.command} won't be saved as it has no preset name\n`);
} else if ((cmd.name != '') && (cmd.command =='')) {
errors.push(`Preset Name: ${cmd.name} has empty FPP command and won't be saved\n`);
errors.push(`Preset Name: ${cmd.name} has empty FPP command and won't be saved\n`);
}

});

if (errors.length > 0) {
alert(errors);
return;
}

data['commands'] = commands;
Expand Down

0 comments on commit 169353b

Please sign in to comment.