From a9aa5225ca919b43433ffe4988bfcea10bedbd1b Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 23 Aug 2019 22:51:50 +0200 Subject: [PATCH] fixed possible bug due to not checking returned value --- retroshare-gui/src/gui/common/FriendListModel.cpp | 6 +++--- retroshare-gui/src/gui/common/FriendListModel.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/common/FriendListModel.cpp b/retroshare-gui/src/gui/common/FriendListModel.cpp index 1989c4b6d..fe2646513 100644 --- a/retroshare-gui/src/gui/common/FriendListModel.cpp +++ b/retroshare-gui/src/gui/common/FriendListModel.cpp @@ -599,6 +599,9 @@ QVariant RsFriendListModel::displayRole(const EntryIndex& e, int col) const { const HierarchicalGroupInformation *group = getGroupInfo(e); + if(!group) + return QVariant(); + uint32_t nb_online = 0; for(uint32_t i=0;ichild_profile_indices.size();++i) @@ -609,9 +612,6 @@ QVariant RsFriendListModel::displayRole(const EntryIndex& e, int col) const break;// only breaks the inner loop, on purpose. } - if(!group) - return QVariant(); - switch(col) { case COLUMN_THREAD_NAME: diff --git a/retroshare-gui/src/gui/common/FriendListModel.h b/retroshare-gui/src/gui/common/FriendListModel.h index 55d53416e..438792add 100644 --- a/retroshare-gui/src/gui/common/FriendListModel.h +++ b/retroshare-gui/src/gui/common/FriendListModel.h @@ -98,9 +98,9 @@ public: // Indices w.r.t. parent. The set of indices entirely determines the position of the entry in the hierarchy. // An index of 0xff means "undefined" - uint8_t group_index; // index of the group in mGroups tab - uint8_t profile_index; // index of the child profile in its own group if group_index < 0xff, or in the mProfiles tab otherwise. - uint8_t node_index; // index of the child node in its own profile + uint16_t group_index; // index of the group in mGroups tab + uint16_t profile_index; // index of the child profile in its own group if group_index < 0xff, or in the mProfiles tab otherwise. + uint16_t node_index; // index of the child node in its own profile EntryIndex parent() const; EntryIndex child(int row,const std::vector& top_level) const;