From d05db6b30565c2bdeee3f8524c6b84dd2a5246c1 Mon Sep 17 00:00:00 2001 From: Effy Elden Date: Sun, 27 Aug 2023 12:23:16 +1000 Subject: [PATCH] Return false for isInDB if DB does not exist Fixes #10 --- crosspost.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crosspost.py b/crosspost.py index 767158e..54e93c8 100644 --- a/crosspost.py +++ b/crosspost.py @@ -373,6 +373,8 @@ def jsonRead(): # Function for checking if a line is already in the database-file def isInDB(line): + if not os.path.exists(databasePath): + return False with open(databasePath, 'r') as file: content = file.read() if line in content: