fix labels crash
This commit is contained in:
parent
f4ee8ed8c8
commit
ff7e527399
1 changed files with 10 additions and 0 deletions
|
@ -34,6 +34,11 @@ QList<Message> LabelsNode::undeletedMessages() const {
|
|||
|
||||
int LabelsNode::countOfUnreadMessages() const {
|
||||
auto chi = childItems();
|
||||
|
||||
if (chi.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return boolinq::from(chi)
|
||||
.max([](RootItem* it) {
|
||||
return it->countOfUnreadMessages();
|
||||
|
@ -43,6 +48,11 @@ int LabelsNode::countOfUnreadMessages() const {
|
|||
|
||||
int LabelsNode::countOfAllMessages() const {
|
||||
auto chi = childItems();
|
||||
|
||||
if (chi.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return boolinq::from(chi)
|
||||
.max([](RootItem* it) {
|
||||
return it->countOfAllMessages();
|
||||
|
|
Loading…
Add table
Reference in a new issue