diff --git a/src/app/AddModuleWindow.cpp b/src/app/AddModuleWindow.cpp index 48f2d91d..9f0af26a 100644 --- a/src/app/AddModuleWindow.cpp +++ b/src/app/AddModuleWindow.cpp @@ -55,7 +55,9 @@ struct MetadataMenu : ListMenu { // Tag list if (!model->tags.empty()) { for (ModelTag tag : model->tags) { - addChild(construct(&MenuEntry::text, gTagNames[tag])); + if (0 <= tag && tag < NUM_TAGS) { + addChild(construct(&MenuEntry::text, gTagNames[tag])); + } } addChild(construct()); } @@ -95,8 +97,10 @@ static bool isModelMatch(Model *model, std::string search) { str += " "; str += model->slug; for (ModelTag tag : model->tags) { - str += " "; - str += gTagNames[tag]; + if (0 <= tag && tag < NUM_TAGS) { + str += " "; + str += gTagNames[tag]; + } } str = tolower(str); search = tolower(search); diff --git a/src/plugin.cpp b/src/plugin.cpp index ad7a868c..374480cd 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -145,6 +145,7 @@ static int loadPlugin(std::string path) { // Add plugin to list gPlugins.push_back(plugin); info("Loaded plugin %s", libraryFilename.c_str()); + return 0; }