Skip to content

fix: handle None rows in export_data to prevent AttributeError (closes #389)#421

Open
botbikamordehai2-sketch wants to merge 1 commit into
shmilylty:masterfrom
botbikamordehai2-sketch:fix/issue-389-1780831118
Open

fix: handle None rows in export_data to prevent AttributeError (closes #389)#421
botbikamordehai2-sketch wants to merge 1 commit into
shmilylty:masterfrom
botbikamordehai2-sketch:fix/issue-389-1780831118

Conversation

@botbikamordehai2-sketch

Copy link
Copy Markdown

What

When exporting subdomain data, if the database table does not exist for a given domain, database.export_data() returns None. The subsequent call to rows.dataset and rows.export() raises AttributeError: 'NoneType' object has no attribute 'scalar' (or similar).

Also, the current code does not gracefully handle missing tables, leading to thread-related SQLite errors when the database is accessed from multiple threads.

Fix

  • Added a null check for rows in export_data() and do_export(). If rows is None, log an error and return early to avoid the attribute error.
  • This prevents the crash and allows the exporter to continue processing other domains.

Closes #389

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'NoneType' object has no attribute 'scalar'

1 participant