Skip to content

Commit

Permalink
fix: only subscribe if IO exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Bloeckchengrafik committed Jan 11, 2024
1 parent 87b9ab2 commit 4562570
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ftswarm-core/src/SwOSSwarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,11 @@ void SwOSSwarm::halt( void ) {
}

void SwOSSwarm::unsubscribe( void ) {

for (uint8_t i=0; i<=maxCtrl; i++)
Ctrl[i]->unsubscribe( true );

if ( Ctrl[i])
Ctrl[i]->unsubscribe( true );
else
printf("[ERROR]: unsubscribe: Ctrl[%d] is NULL\n", i );
}

uint8_t SwOSSwarm::getIndex( FtSwarmSerialNumber_t serialNumber ) {
Expand Down

0 comments on commit 4562570

Please sign in to comment.