Skip to content

Commit

Permalink
Fix addtaxonomy always crashing due to invalid check
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Sep 10, 2020
1 parent 29e327f commit 333cc35
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/taxonomy/addtaxonomy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ int addtaxonomy(int argc, const char **argv, const Command &command) {
if (par.pickIdFrom == Parameters::EXTRACT_QUERY) {
val.first = key;
mappingIt = std::upper_bound(mapping.begin(), mapping.end(), val, compareToFirstInt);
}
if (mappingIt == mapping.end() || mappingIt->first != val.first) {
taxonNotFound++;
continue;
if (mappingIt == mapping.end() || mappingIt->first != val.first) {
taxonNotFound++;
continue;
}
}

while (*data != '\0') {
Expand All @@ -87,11 +87,11 @@ int addtaxonomy(int argc, const char **argv, const Command &command) {
unsigned int id = Util::fast_atoi<unsigned int>(entry[0]);
val.first = id;
mappingIt = std::upper_bound(mapping.begin(), mapping.end(), val, compareToFirstInt);
}
if (mappingIt == mapping.end() || mappingIt->first != val.first) {
taxonNotFound++;
data = Util::skipLine(data);
continue;
if (mappingIt == mapping.end() || mappingIt->first != val.first) {
taxonNotFound++;
data = Util::skipLine(data);
continue;
}
}
unsigned int taxon = mappingIt->second;
TaxonNode const *node = t->taxonNode(taxon, false);
Expand Down

0 comments on commit 333cc35

Please sign in to comment.