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 { ...@@ -181,7 +181,7 @@ RegleVoisinage* Database::getRegleVoisinage(const QString& name) const {
regle = new RegleVoisinageMoore; regle = new RegleVoisinageMoore;
dynamic_cast<RegleVoisinageMoore*>(regle)->setr(query.value("rayon").toInt()); 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.prepare("SELECT x, y FROM coord_voisinage WHERE id = :id");
query.bindValue(":id", name); query.bindValue(":id", name);
query.exec(); query.exec();
...@@ -197,6 +197,9 @@ RegleVoisinage* Database::getRegleVoisinage(const QString& name) const { ...@@ -197,6 +197,9 @@ RegleVoisinage* Database::getRegleVoisinage(const QString& name) const {
dynamic_cast<RegleVoisinageArbitraire*>(regle)->coordonnees.push_back(coord); dynamic_cast<RegleVoisinageArbitraire*>(regle)->coordonnees.push_back(coord);
} while(query.next()); } while(query.next());
} }
else {
throw "Unknown type of neighbourhood!";
}
return regle; 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