Add a critical warning and skip when attempting to add a duplicate session to a Machine object.

This prevents duplicate sessions from being added to Day during a rebuild, but is still not
the root cause. The next step will be to address the attempted duplication in Machine.
This commit is contained in:
sawinglogz 2019-08-15 16:18:23 -04:00
parent 7d72f71fb4
commit 6f7a49f949

View File

@ -285,6 +285,10 @@ bool Machine::AddSession(Session *s)
qCritical() << "AddSession() called without a valid profile"; qCritical() << "AddSession() called without a valid profile";
return false; return false;
} }
if (sessionlist.contains(s->session())) {
qCritical() << "Machine::AddSession called with duplicate session" << s->session() << "for machine" << serial();
return false;
}
if (profile->session->ignoreOlderSessions()) { if (profile->session->ignoreOlderSessions()) {
qint64 ignorebefore = profile->session->ignoreOlderSessionsDate().toMSecsSinceEpoch(); qint64 ignorebefore = profile->session->ignoreOlderSessionsDate().toMSecsSinceEpoch();