Fix assert in unread count check during startup

Authored by jkt on Jan 3 2018, 4:39 PM.

Description

Fix assert in unread count check during startup

The "simple" QaimDfsIterator constructor which only takes a QModelIndex
and not a pair of (QMI, QAIM) asserts when fed with an invalid iterator.
This can happen in case the mailbox list is not available for some
reason:

ASSERT: "m_model" in file /home/jkt/work/prog/trojita/src/UiUtils/QaimDfsIterator.cpp, line 32
[...]
#5  0x000000000066dc15 in UiUtils::QaimDfsIterator::QaimDfsIterator(QModelIndex const&) ()
#6  0x0000000000476483 in Gui::MainWindow::handleTrayIconChange() ()
#7  0x0000000000475dda in Gui::MainWindow::createSysTray() ()
#8  0x0000000000469077 in Gui::MainWindow::slotToggleSysTray() ()
#9  0x0000000000458fb5 in Gui::MainWindow::MainWindow(QSettings*) ()
#10 0x0000000000454bab in main ()

Change-Id: Ie9d71b06c86f9f06ea103fee94b414397e379f4b

Details

Committed
jktJan 3 2018, 4:39 PM
Parents
R546:6e96ab832d3e: threading: Assert before a possible null-ptr dereference
Branches
Unknown
Tags
Unknown
References
refs/changes/78/978/1