Merge "Fix exception when path not found."

This commit is contained in:
Christopher Ferris
2022-01-26 18:01:37 +00:00
committed by Gerrit Code Review

View File

@@ -332,7 +332,7 @@ class TraceConverter:
# Search for a library with the given basename and build_id anywhere in the symbols directory. # Search for a library with the given basename and build_id anywhere in the symbols directory.
@functools.lru_cache(maxsize=None) @functools.lru_cache(maxsize=None)
def GetLibraryByBuildId(self, symbols_dir, basename, build_id): def GetLibraryByBuildId(self, symbols_dir, basename, build_id):
for candidate in self.GlobSymbolsDir(symbols_dir).get(basename): for candidate in self.GlobSymbolsDir(symbols_dir).get(basename, []):
info = self.GetLibraryInfo(candidate) info = self.GetLibraryInfo(candidate)
if info and info.build_id == build_id: if info and info.build_id == build_id:
return "/" + str(candidate.relative_to(symbols_dir)) return "/" + str(candidate.relative_to(symbols_dir))