fixed possible bug due to not checking returned value

This commit is contained in:
csoler 2019-08-23 22:51:50 +02:00
parent cc32de8466
commit a9aa5225ca
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
2 changed files with 6 additions and 6 deletions

View File

@ -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;i<group->child_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:

View File

@ -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<EntryIndex>& top_level) const;