aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'libpathod/app.py')
-rw-r--r--libpathod/app.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/libpathod/app.py b/libpathod/app.py
index 17be448d..e93a898f 100644
--- a/libpathod/app.py
+++ b/libpathod/app.py
@@ -82,12 +82,17 @@ def _preview(is_request):
template = "response_preview.html"
spec = request.args["spec"]
+
args = dict(
spec = spec,
section = "main",
syntaxerror = None,
error = None
)
+ if not spec.strip():
+ args["error"] = "Can't parse an empty spec."
+ return render(template, **args)
+
try:
if is_request:
r = rparse.parse_request(app.config["pathod"].request_settings, spec)