Skip to content

Bug in 'get_contact_by_email' #281

@matthewgdv

Description

@matthewgdv

Heya, I've noticed that on line 712 of address_book.py:

contacts[0] if contacts else None

a generator is being tested for truthiness (will always return True) and having item access attempted on it (will always raise TypeError).

The fix should be as easy as wrapping the previous line in list(), like so:

contacts = list(self.get_contacts(limit=1, query=query))

where currently it looks like:
contacts = self.get_contacts(limit=1, query=query)

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions