Fix suggestion for issue #3240

L135: If `getattr()` returns `None`, use `""` instead to avoid error in issue #3240
This commit is contained in:
keikari 2021-05-12 18:30:38 +03:00 committed by GitHub
parent eba0c9be34
commit d9413039ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -132,7 +132,7 @@ class SourceManager:
else: else:
streams = list(self._sources.values()) streams = list(self._sources.values())
if sort_by: if sort_by:
streams.sort(key=lambda s: getattr(s, sort_by)) streams.sort(key=lambda s: getattr(s, sort_by) or "")
if reverse: if reverse:
streams.reverse() streams.reverse()
return streams return streams