Verified Commit ea4fa442 authored by Romain De Laage De Bellefaye's avatar Romain De Laage De Bellefaye 🌳
Browse files

Resolve first segfault

parent eda64c01
Pipeline #79804 passed with stage
in 16 seconds
......@@ -181,7 +181,7 @@ RegleVoisinage* Database::getRegleVoisinage(const QString& name) const {
regle = new RegleVoisinageMoore;
dynamic_cast<RegleVoisinageMoore*>(regle)->setr(query.value("rayon").toInt());
}
else if(type != 3) {
else if(type == 3) {
query.prepare("SELECT x, y FROM coord_voisinage WHERE id = :id");
query.bindValue(":id", name);
query.exec();
......@@ -197,6 +197,9 @@ RegleVoisinage* Database::getRegleVoisinage(const QString& name) const {
dynamic_cast<RegleVoisinageArbitraire*>(regle)->coordonnees.push_back(coord);
} while(query.next());
}
else {
throw "Unknown type of neighbourhood!";
}
return regle;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment