Skip to content

Commit

Permalink
Fix None entity in filing header
Browse files Browse the repository at this point in the history
  • Loading branch information
dgunning committed Aug 27, 2024
1 parent dd7e901 commit 455a58b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion edgar/filingheader.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def parse_from_sgml_text(cls, header_text: str, preprocess=False):
if cik:
from edgar.entities import Entity, EntityData
entity: EntityData = Entity(cik, include_old_filings=False)
if not entity.is_company:
if entity and not entity.is_company:
name = reverse_name(name)
owner = Owner(name=name, cik=cik)

Expand Down
7 changes: 7 additions & 0 deletions tests/test_filing_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,3 +376,10 @@ def test_get_header_from_old_filing():
accession_no='0001012325-98-000004')
header = filing.header
assert header.accession_number == '0001012325-98-000004'


def test_get_header_for_filing_with_no_reportingowner_entity():
filing = Filing(form='4', filing_date='2024-08-23', company='Hut 8 Corp.', cik=1964789,
accession_no='0001127602-24-022866')
header = filing.header
assert header

0 comments on commit 455a58b

Please sign in to comment.