From d9413039ec2eee312e2b0a00b866bfaf3d3881b8 Mon Sep 17 00:00:00 2001 From: keikari <34790748+keikari@users.noreply.github.com> Date: Wed, 12 May 2021 18:30:38 +0300 Subject: [PATCH] Fix suggestion for issue #3240 L135: If `getattr()` returns `None`, use `""` instead to avoid error in issue #3240 --- lbry/file/source_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbry/file/source_manager.py b/lbry/file/source_manager.py index b4babc7a9..356dcb74d 100644 --- a/lbry/file/source_manager.py +++ b/lbry/file/source_manager.py @@ -132,7 +132,7 @@ class SourceManager: else: streams = list(self._sources.values()) if sort_by: - streams.sort(key=lambda s: getattr(s, sort_by)) + streams.sort(key=lambda s: getattr(s, sort_by) or "") if reverse: streams.reverse() return streams