mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed possible bug due to not checking returned value
This commit is contained in:
parent
cc32de8466
commit
a9aa5225ca
@ -599,6 +599,9 @@ QVariant RsFriendListModel::displayRole(const EntryIndex& e, int col) const
|
|||||||
{
|
{
|
||||||
const HierarchicalGroupInformation *group = getGroupInfo(e);
|
const HierarchicalGroupInformation *group = getGroupInfo(e);
|
||||||
|
|
||||||
|
if(!group)
|
||||||
|
return QVariant();
|
||||||
|
|
||||||
uint32_t nb_online = 0;
|
uint32_t nb_online = 0;
|
||||||
|
|
||||||
for(uint32_t i=0;i<group->child_profile_indices.size();++i)
|
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.
|
break;// only breaks the inner loop, on purpose.
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!group)
|
|
||||||
return QVariant();
|
|
||||||
|
|
||||||
switch(col)
|
switch(col)
|
||||||
{
|
{
|
||||||
case COLUMN_THREAD_NAME:
|
case COLUMN_THREAD_NAME:
|
||||||
|
@ -98,9 +98,9 @@ public:
|
|||||||
// Indices w.r.t. parent. The set of indices entirely determines the position of the entry in the hierarchy.
|
// 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"
|
// An index of 0xff means "undefined"
|
||||||
|
|
||||||
uint8_t group_index; // index of the group in mGroups tab
|
uint16_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.
|
uint16_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 node_index; // index of the child node in its own profile
|
||||||
|
|
||||||
EntryIndex parent() const;
|
EntryIndex parent() const;
|
||||||
EntryIndex child(int row,const std::vector<EntryIndex>& top_level) const;
|
EntryIndex child(int row,const std::vector<EntryIndex>& top_level) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user