Nullptr safety.

(cherry picked from commit 92b9997948)
This commit is contained in:
Jeff Young
2025-07-08 08:44:21 +01:00
parent 31af54d978
commit f417e5b0e5
3 changed files with 13 additions and 7 deletions
+3 -1
View File
@@ -1081,7 +1081,9 @@ void VIEW::draw( VIEW_ITEM* aItem, bool aImmediate )
if( it == m_layers.end() )
continue;
m_gal->SetLayerDepth( it->second.renderingOrder );
if( m_gal )
m_gal->SetLayerDepth( it->second.renderingOrder );
draw( aItem, layer, aImmediate );
}
}
+1 -1
View File
@@ -714,6 +714,6 @@ void DIALOG_FIELD_PROPERTIES::UpdateField( SCH_COMMIT* aCommit, SCH_FIELD* aFiel
parent->SetFieldsAutoplaced( AUTOPLACE_NONE );
// Update the hierarchy navigator labels if needed.
if( needUpdateHierNav )
if( editFrame && needUpdateHierNav )
editFrame->UpdateLabelsHierarchyNavigator();
}
+9 -5
View File
@@ -45,13 +45,17 @@ PCB_PICKER_TOOL::PCB_PICKER_TOOL() :
bool PCB_PICKER_TOOL::Init()
{
PCB_BASE_FRAME* frame = getEditFrame<PCB_BASE_FRAME>();
MAGNETIC_SETTINGS& magneticSettings = *frame->GetMagneticItemsSettings();
MAGNETIC_SETTINGS magneticSettings;
CONDITIONAL_MENU& menu = m_menu->GetMenu();
const auto snapIsSetToAllLayers = [&]( const SELECTION& aSel )
{
return magneticSettings.allLayers;
};
if( frame )
magneticSettings = *frame->GetMagneticItemsSettings();
const auto snapIsSetToAllLayers =
[&]( const SELECTION& aSel )
{
return magneticSettings.allLayers;
};
// "Cancel" goes at the top of the context menu when a tool is active
menu.AddItem( ACTIONS::cancelInteractive, SELECTION_CONDITIONS::ShowAlways, 1 );