diff options
| -rw-r--r-- | muggle-plugin/mg_db.c | 2 | ||||
| -rw-r--r-- | muggle-plugin/mg_order.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/muggle-plugin/mg_db.c b/muggle-plugin/mg_db.c index cba9baf..aa84ef4 100644 --- a/muggle-plugin/mg_db.c +++ b/muggle-plugin/mg_db.c @@ -1012,6 +1012,8 @@ bool mgSelection::enter (unsigned int position) return false; setPosition (position); position = gotoPosition(); // reload adjusted position + if (values.size()==0) + return false; string value = values[position]; string id = m_ids[position]; mgSelStrings prev; diff --git a/muggle-plugin/mg_order.c b/muggle-plugin/mg_order.c index cc93141..93463b5 100644 --- a/muggle-plugin/mg_order.c +++ b/muggle-plugin/mg_order.c @@ -625,7 +625,7 @@ operator==(const mgOrder& a, const mgOrder &b) const mgOrder& mgOrder::operator=(const mgOrder& from) { - Keys.clear(); + clear(); for (unsigned int i = 0; i < from.size();i++) { mgKey *k = ktGenerate(from.getKeyType(i),m_db); @@ -811,7 +811,8 @@ cleanagain: goto cleanagain; } } - if (!is_unique) + bool IsCollection = size()==0 ? false : Keys[0]->Type()==keyCollection; + if (!IsCollection && !is_unique) { if (!album_found) Keys.push_back(ktGenerate(keyAlbum,m_db)); |
