diff --git a/swh/storage/converters.py b/swh/storage/converters.py --- a/swh/storage/converters.py +++ b/swh/storage/converters.py @@ -52,6 +52,8 @@ dict: a dictionary with four keys: id, fullname, name and email, or None if the id is None """ + if (fullname, name, email) == (None, None, None): + return None return { "fullname": fullname, "name": name, diff --git a/swh/storage/tests/test_converters.py b/swh/storage/tests/test_converters.py --- a/swh/storage/tests/test_converters.py +++ b/swh/storage/tests/test_converters.py @@ -55,6 +55,14 @@ } +def test_db_to_author_none(): + # when + actual_author = converters.db_to_author(None, None, None) + + # then + assert actual_author is None + + def test_db_to_revision(): # when actual_revision = converters.db_to_revision(