From d800556bd50ecb78c21343a288f9475b8b870162 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Fri, 19 Oct 2018 15:55:17 -0400 Subject: Just return None rather than crashing, when trying to read cookies within tasks (closes #143) --- src/c/urweb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/c/urweb.c') diff --git a/src/c/urweb.c b/src/c/urweb.c index e7efae38..2e3e18bc 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -737,7 +737,10 @@ void uw_close(uw_context ctx) { } uw_Basis_string uw_Basis_requestHeader(uw_context ctx, uw_Basis_string h) { - return ctx->get_header(ctx->get_header_data, h); + if (ctx->get_header) + return ctx->get_header(ctx->get_header_data, h); + else + return NULL; } void uw_set_headers(uw_context ctx, char *(*get_header)(void *, const char *), void *get_header_data) { -- cgit v1.2.3