Check for file writability before saving part
This is a 5.1 only fix for this crash. Fixing in master requires a major refactor of the library writability detection code. Fixes https://gitlab.com/kicad/code/kicad/issues/3864
This commit is contained in:
parent
bd1fb845b1
commit
6b2a8f54a1
|
@ -373,6 +373,14 @@ void LIB_EDIT_FRAME::OnSave( wxCommandEvent& aEvent )
|
|||
}
|
||||
else
|
||||
{
|
||||
wxFileName fn = Prj().SchSymbolLibTable()->GetFullURI( libName );
|
||||
wxFileName docFileName = fn;
|
||||
docFileName.SetExt( DOC_EXT );
|
||||
|
||||
// Verify the user has write privileges before attempting to save the library file.
|
||||
if( !IsWritable( fn ) || !IsWritable( docFileName ) )
|
||||
return;
|
||||
|
||||
// Save Part
|
||||
if( m_libMgr->FlushPart( partName, libName ) )
|
||||
m_libMgr->ClearPartModified( partName, libName );
|
||||
|
|
Loading…
Reference in New Issue