Browse Source

Eeschema, fields_grid_table.cpp: fix a crash when the eeschema settings are not available.

It happens if the svhematic is not open when opening the symbol editor.
Fix also a compil warning.

Fixes #6384
https://gitlab.com/kicad/code/kicad/issues/6384
6.0.7
jean-pierre charras 5 years ago
parent
commit
9aa6e40b79
  1. 4
      eeschema/fields_grid_table.cpp
  2. 3
      pcbnew/pcb_shape.h

4
eeschema/fields_grid_table.cpp

@ -309,7 +309,9 @@ wxGridCellAttr* FIELDS_GRID_TABLE<T>::GetAttr( int aRow, int aCol, wxGridCellAtt
wxString fn = GetValue( aRow, FDC_NAME );
SCHEMATIC_SETTINGS* settings = m_frame->Prj().GetProjectFile().m_SchematicSettings;
const TEMPLATE_FIELDNAME* templateFn = settings->m_TemplateFieldNames.GetFieldName( fn );
const TEMPLATE_FIELDNAME* templateFn =
settings ? settings->m_TemplateFieldNames.GetFieldName( fn ) : nullptr;
if( templateFn && templateFn->m_URL )
{

3
pcbnew/pcb_shape.h

@ -106,6 +106,9 @@ public:
case S_ARC:
case S_CURVE:
return false;
case S_LAST: // Sentinel
break;
}
return false; // Make compil happy

Loading…
Cancel
Save