Skip to content

BUG: fetch_equals crashes if there are no rows to return #9

Description

@CHerSun

Lines in fetch_equals:

        cur.execute(f"SELECT * FROM {table_name} WHERE {field} = ?;", (value, ))
        obj_id, *field_values = list(cur.fetchone())

crash execution due to None being returned from cur.fetchone() if there are no rows.

A fix could be:

        row = cur.fetchone()
        if not row:
            return None
        obj_id, *field_values = list(row)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions