From a3a970a22f51de07df479af0a675dda551ec8e3c Mon Sep 17 00:00:00 2001 From: yrriban Date: Wed, 24 Dec 2025 11:59:26 -0500 Subject: [PATCH] Check to see any WADs were returned before trying to fetch them. --- dcc/fetch.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dcc/fetch.py b/dcc/fetch.py index ed2aaca..fd53f55 100644 --- a/dcc/fetch.py +++ b/dcc/fetch.py @@ -4,6 +4,7 @@ import json import pathlib import shutil import subprocess +import sys import urllib.request import zipfile @@ -40,6 +41,8 @@ class Fetch(dcc.config.Base): "https://www.doomworld.com/idgames/api/" + "api.php?action=search&query={}&out=json".format(wad) ) + if "content" not in reply: + sys.exit(f"No WAD named {wad} found on idgames.") files = reply["content"]["file"] if type(files) is dict: # One result. return files["id"]