fixes Coverity issue 109780 in project_rescue.cpp: an uncaught exception on load or save of the project library list
This commit is contained in:
parent
ef2e05c8d7
commit
140d17bf82
|
@ -101,6 +101,8 @@ static bool insert_library( PROJECT *aProject, PART_LIB *aLibrary, size_t aIndex
|
|||
aProject->SetElem( PROJECT::ELEM_SCH_PART_LIBS, libs );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
PART_LIBS::LibNamesAndPaths( aProject, false, &libPaths, &libNames );
|
||||
|
||||
// Make sure the library is not already in the list
|
||||
|
@ -110,6 +112,12 @@ static bool insert_library( PROJECT *aProject, PART_LIB *aLibrary, size_t aIndex
|
|||
// Add the library to the list and save
|
||||
libNames.Insert( libName, aIndex );
|
||||
PART_LIBS::LibNamesAndPaths( aProject, true, &libPaths, &libNames );
|
||||
}
|
||||
catch( const IO_ERROR& e )
|
||||
{
|
||||
// Could not get or save the current libraries.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Save the old libraries in case there is a problem after clear(). We'll
|
||||
// put them back in.
|
||||
|
|
Loading…
Reference in New Issue