summaryrefslogtreecommitdiff
path: root/jq.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'jq.pyx')
-rw-r--r--jq.pyx3
1 files changed, 3 insertions, 0 deletions
diff --git a/jq.pyx b/jq.pyx
index 447eeb1..604363a 100644
--- a/jq.pyx
+++ b/jq.pyx
@@ -67,6 +67,9 @@ def _string_to_strings(char* program, char* input):
# TODO: error if !compiled
cdef int compiled = jq_compile(jq, program)
+ if not compiled:
+ raise ValueError("program was not valid")
+
cdef jv_parser parser
jv_parser_init(&parser)
# TODO: is len a suitable replacement for strlen (unicode)?