Skip to content

Commit

Permalink
Add NULL check to wokring set change due to working set disappearance
Browse files Browse the repository at this point in the history
  • Loading branch information
martonmiklos authored and GwnDaan committed Jan 7, 2025
1 parent 3f07b08 commit cc02258
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ServerMainComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,16 @@ void ServerMainComponent::timerCallback()
if (nextWorkingSet->get_control_function()->get_address() != activeWorkingSetMasterAddress)
{
activeWorkingSetMasterAddress = nextWorkingSet->get_control_function()->get_address();
activeWorkingSetDataMaskObjectID = std::static_pointer_cast<isobus::WorkingSet>(nextWorkingSet->get_working_set_object())->get_active_mask();
newWorkingSetFound = true;
if (nextWorkingSet->get_working_set_object())
{
activeWorkingSetDataMaskObjectID = std::static_pointer_cast<isobus::WorkingSet>(nextWorkingSet->get_working_set_object())->get_active_mask();
newWorkingSetFound = true;
}
else
{
activeWorkingSetDataMaskObjectID = isobus::NULL_OBJECT_ID;
newWorkingSetFound = false;
}
break;
}
}
Expand Down

0 comments on commit cc02258

Please sign in to comment.