Skip to content

Commit

Permalink
Add check to ensure SQLite DB exists before attempting to open.
Browse files Browse the repository at this point in the history
  • Loading branch information
obsidianforensics committed Apr 29, 2024
1 parent 5a7196f commit 20c8514
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyhindsight/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def text_factory(row_data):
def open_sqlite_db(chrome, database_path, database_name):
log.info(f' - Reading from {database_name} in {database_path}')

if not os.path.exists(os.path.join(database_path, database_name)):
log.info(f' - Failed; {database_name} does not exist in {database_path}')
return False

if chrome.no_copy:
db_path_to_open = os.path.join(database_path, database_name)

Expand Down

0 comments on commit 20c8514

Please sign in to comment.