Skip to content

Commit

Permalink
Fix crash if Mega API key is not provided
Browse files Browse the repository at this point in the history
Signed-off-by: lzzy12 <[email protected]>
  • Loading branch information
lzzy12 committed Jun 19, 2020
1 parent c6a430a commit 45f75fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def getConfig(name: str):
MEGA_API_KEY = getConfig('MEGA_API_KEY')
except KeyError:
logging.warning('MEGA API KEY not provided!')

MEGA_API_KEY = None
try:
MEGA_EMAIL_ID = getConfig('MEGA_EMAIL_ID')
MEGA_PASSWORD = getConfig('MEGA_PASSWORD')
Expand Down
3 changes: 2 additions & 1 deletion bot/helper/mirror_utils/download_utils/mega_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ class MegaDownloadHelper:
def __init__(self):
pass

def add_download(self, mega_link: str, path: str, listener):
@staticmethod
def add_download(mega_link: str, path: str, listener):
if MEGA_API_KEY is None:
raise MegaDownloaderException('Mega API KEY not provided! Cannot mirror mega links')
executor = AsyncExecutor()
Expand Down

0 comments on commit 45f75fb

Please sign in to comment.