Check normalize path result instead of blindly using it.

Fix #7323 again
This commit is contained in:
Marek Roszko 2021-02-05 00:52:41 -05:00
parent 1572d90ee7
commit 4c1b4b4159
1 changed files with 5 additions and 0 deletions

View File

@ -750,6 +750,11 @@ void PANEL_SYM_LIB_TABLE::onConvertLegacyLibraries( wxCommandEvent& event )
relPath = NormalizePath( newLib.GetFullPath(), &Pgm().GetLocalEnvVariables(),
m_project );
// Do not use the project path in the global library table. This will almost
// assuredly be wrong for a different project.
if( relPath.IsEmpty() || (m_cur_grid == m_global_grid && relPath.Contains( "${KIPRJMOD}" ) ) )
relPath = newLib.GetFullPath();
auto model = static_cast<SYMBOL_LIB_TABLE_GRID*>( m_cur_grid->GetTable() );
model->SetValue( row, COL_URI, relPath );
model->SetValue( row, COL_TYPE, kicadType );