Skip to content

Fix: prevent IndexError in list_corrupted_runs for empty prefix#3400

Open
Regg819 wants to merge 1 commit intoaimhubio:mainfrom
Regg819:fix/issue-3390-crash
Open

Fix: prevent IndexError in list_corrupted_runs for empty prefix#3400
Regg819 wants to merge 1 commit intoaimhubio:mainfrom
Regg819:fix/issue-3390-crash

Conversation

@Regg819
Copy link
Copy Markdown

@Regg819 Regg819 commented Apr 1, 2026

Summary

Fixes a crash in list_corrupted_runs() when processing corrupted databases with empty prefixes.

Bug

Fix

  • Add check for empty path in get_run_hash_from_prefix
  • Return None for empty paths and filter them out
  • Prevents crash when corrupted DB has empty prefix entries

Testing

This fix handles the edge case where corrupted_dbs contains entries with empty byte string prefixes.

Buy Me a Coffee at ko-fi.com

When decode_path() returns an empty list for an empty byte string prefix,
accessing [-1] causes IndexError. This fix adds a check to return None
for empty paths and filters them out, preventing the crash.

Fixes issue aimhubio#3390
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 1, 2026

CLA assistant check
All committers have signed the CLA.

@Regg819
Copy link
Copy Markdown
Author

Regg819 commented Apr 1, 2026

Hi team! Just checking in on this PR. Happy to address any feedback or make adjustments. Thanks!

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.

2 participants