Skip to content

Commit c280260

Browse files
author
Alexandre jublot
committed
fix: added check for null callback pointer
1 parent 9ec6c3f commit c280260

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/src/udp/APacketHandler.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ void polymorph::network::udp::APacketHandler::_broadcastReceivedPacket(const pol
7575
std::vector<std::shared_ptr<std::function<int(const PacketHeader &, const std::vector<std::byte> &)>>> callbacksToPop;
7676

7777
for (auto &callback : _receiveCallbacks[header.opId]) {
78+
if (!callback) {
79+
callbacksToPop.push_back(callback);
80+
continue;
81+
}
7882
auto res = (*callback)(header, bytes);
7983
if (res == 0)
8084
callbacksToPop.push_back(callback);

0 commit comments

Comments
 (0)