diff options
author | Adam Chlipala <adam@chlipala.net> | 2018-10-19 15:55:17 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2018-10-19 15:55:17 -0400 |
commit | d800556bd50ecb78c21343a288f9475b8b870162 (patch) | |
tree | d031992d3d4d6809969b712ba44ace1eaea667e3 /src/c | |
parent | e798117b42c5df30d1b3778d6414467e8e7b1e04 (diff) |
Just return None rather than crashing, when trying to read cookies within tasks (closes #143)
Diffstat (limited to 'src/c')
-rw-r--r-- | src/c/urweb.c | 5 |
1 files changed, 4 insertions, 1 deletions
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) { |