Eeschema: fix crash when trying to save as a library in a non writable folder.

The crash was due to a non caught thrown error.

Fixes #4914
https://gitlab.com/kicad/code/kicad/issues/4914
This commit is contained in:
jean-pierre charras 2020-07-19 18:27:19 +02:00
parent ba90416096
commit 1d450adfdf
1 changed files with 11 additions and 1 deletions

View File

@ -209,7 +209,17 @@ bool LIB_MANAGER::SaveLibrary( const wxString& aLibrary, const wxString& aFileNa
}
}
pi->SaveLibrary( aFileName );
try
{
pi->SaveLibrary( aFileName );
}
catch( ... )
{
// return false because something happens.
// The library is not successfully saved
res = false;
}
return res;
}