Browse Source

Remove models without names

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
ca5e496375
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      src/plugin.cpp

+ 6
- 3
src/plugin.cpp View File

@@ -143,11 +143,14 @@ static Plugin *loadPlugin(std::string path) {
throw UserException(string::f("Plugin %s is already loaded, not attempting to load it again", plugin->slug.c_str()));
}

// Check that all modules have names
for (Model *model : plugin->models) {
// Remove models without names
for (auto it = plugin->models.begin(); it != plugin->models.end();) {
Model *model = *it;
if (model->name == "") {
throw UserException(string::f("Module %s has no name", model->slug.c_str()));
it = plugin->models.erase(it);
continue;
}
it++;
}

// Normalize tags


Loading…
Cancel
Save