Ignore empty script paths

This commit is contained in:
GriffinR 2023-09-06 21:52:42 -04:00
parent 885695e705
commit 7411ddaeef

View file

@ -214,9 +214,12 @@ void CustomScriptsEditor::save() {
QList<bool> enabledStates; QList<bool> enabledStates;
for (int i = 0; i < ui->list->count(); i++) { for (int i = 0; i < ui->list->count(); i++) {
auto item = ui->list->item(i); auto item = ui->list->item(i);
paths.append(this->getScriptFilepath(item, false)); const QString path = this->getScriptFilepath(item, false);
if (!path.isEmpty()) {
paths.append(path);
enabledStates.append(this->getScriptEnabled(item)); enabledStates.append(this->getScriptEnabled(item));
} }
}
userConfig.setCustomScripts(paths, enabledStates); userConfig.setCustomScripts(paths, enabledStates);
this->hasUnsavedChanges = false; this->hasUnsavedChanges = false;