python scripting: better fix for commit 5a79821 (fix crash due to a null pointer):

Try to use a better error message for severity.
Fixes #13160
https://gitlab.com/kicad/code/kicad/issues/13160
This commit is contained in:
jean-pierre charras 2022-12-18 18:18:53 +01:00
parent e3b8475a3d
commit 6c73fe05e9
1 changed files with 1 additions and 1 deletions

View File

@ -534,7 +534,7 @@ bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits,
for( const std::shared_ptr<DRC_ITEM>& item : violations )
{
SEVERITY severity = item->GetParent() ? item->GetParent()->GetSeverity()
: RPT_SEVERITY_UNDEFINED;
: bds.GetSeverity( item->GetErrorCode() );
fprintf( fp, "%s", TO_UTF8( item->ShowReport( &unitsProvider, severity, itemMap ) ) );
}