diff options
author | Adam Chlipala <adam@chlipala.net> | 2014-03-04 08:46:33 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2014-03-04 08:46:33 -0500 |
commit | 5b61100181d61708ad6c1047bd96cecf43630004 (patch) | |
tree | 74eaa6047d1c0a7049c08672ea43137182df004a /src | |
parent | 79a91292adaa9cd76edaf986ffe6ac7e9093260c (diff) |
Change Basis.getenv to return None outside the context of a web request
Diffstat (limited to 'src')
-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 9bf72ce1..5ac5aa55 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -3669,7 +3669,10 @@ uw_unit uw_Basis_setHeader(uw_context ctx, uw_Basis_string name, uw_Basis_string } uw_Basis_string uw_Basis_getenv(uw_context ctx, uw_Basis_string name) { - return ctx->get_env(ctx->get_env_data, name); + if (ctx->get_env) + return ctx->get_env(ctx->get_env_data, name); + else + return NULL; } uw_Basis_string uw_unnull(uw_Basis_string s) { |