From 0bf1d470da90f5258628450507a9b3310da34791 Mon Sep 17 00:00:00 2001 From: BluBb_mADe Date: Tue, 4 Jun 2019 18:37:25 +0200 Subject: [PATCH] fixed server start crash if a file didn't contain a "_" --- sharex_server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sharex_server.py b/sharex_server.py index 7085e63..54bd82a 100644 --- a/sharex_server.py +++ b/sharex_server.py @@ -138,8 +138,9 @@ def main(): if not os.path.isdir(f'{conf.data_path}/{acc}'): continue for file in os.listdir(f"{conf.data_path}/{acc}"): - fhash, fname = file.split('_', 1) - file_db[acc][fhash] = fname + if "_" in file: + fhash, fname = file.split('_', 1) + file_db[acc][fhash] = fname app = web.Application(middlewares=[prepare]) app.router.add_post(conf.prefix + '/post/{acc}', handle_upload)