Avoid possibly accessing packageCacheDirs when it is empty

This commit is contained in:
Martchus 2022-03-15 01:08:19 +01:00
parent f87829ba85
commit af66549d87
1 changed files with 1 additions and 1 deletions

View File

@ -134,7 +134,7 @@ void Config::loadPacmanConfig(const char *pacmanConfigPath)
if (db->localDbDir.empty()) {
db->localDbDir = pacmanDatabasePath + "sync";
}
if (db->localPkgDir.empty()) {
if (db->localPkgDir.empty() && !packageCacheDirs.empty()) {
db->localPkgDir = packageCacheDirs.front();
}
// ensure the database is not being discarded