Ensure model file output stream is valid before writing to it

Fixes KICAD-74V
This commit is contained in:
Ian McInerney 2024-02-16 11:35:22 +00:00 committed by Ian McInerney
parent e67eae90e9
commit 90ace0fcaf
1 changed files with 7 additions and 0 deletions

View File

@ -1695,6 +1695,13 @@ void ALTIUM_PCB::ParseModelsData( const ALTIUM_COMPOUND_FILE& aAltiumPcbFile
wxZlibInputStream zlibInputStream( stepStream );
wxFFileOutputStream outputStream( storagePath.GetFullPath() );
if( !outputStream.IsOk() )
{
wxLogError( _( "Unable to write file '%s'." ), storagePath.GetFullPath() );
continue;
}
outputStream.Write( zlibInputStream );
outputStream.Close();