Skip to content

Commit da1f2bf

Browse files
Fix: Handle empty pulse/group lists gracefully in Wire
- updateGroups(): Add early return when pulse list is empty - fetchGroupPtrs(): Skip GXS request when group ID list is empty This prevents error spam in logs when viewing Wire with no pulses and avoids the GXS warning about empty group ID lists.
1 parent 4a534e6 commit da1f2bf

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/services/p3wire.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,12 @@ bool p3Wire::updatePulseChildren(RsWirePulseSPtr pParent, uint32_t token)
14531453

14541454
bool p3Wire::updateGroups(std::list<RsWirePulseSPtr> &pulsePtrs)
14551455
{
1456+
// Early return if no pulses - nothing to update
1457+
if (pulsePtrs.empty())
1458+
{
1459+
return true;
1460+
}
1461+
14561462
std::set<RsGxsGroupId> pulseGroupIds;
14571463

14581464
std::list<RsWirePulseSPtr>::iterator it;
@@ -1651,6 +1657,12 @@ bool p3Wire::fetchGroupPtrs(const std::list<RsGxsGroupId> &groupIds,
16511657
std::cerr << "p3Wire::fetchGroupPtrs()";
16521658
std::cerr << std::endl;
16531659

1660+
// Handle empty list gracefully - nothing to fetch
1661+
if (groupIds.empty())
1662+
{
1663+
return true;
1664+
}
1665+
16541666
uint32_t token;
16551667
RsTokReqOptions opts;
16561668
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;

0 commit comments

Comments
 (0)