From: Timo Sirainen Date: Wed, 29 Jun 2016 16:22:51 +0000 (+0300) Subject: dict-sql: Treat NULL value the same as "key not found" X-Git-Tag: 2.3.0.rc1~3378 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b97d8b3f6edc867d940cd7aa76dccd46c2323b7;p=thirdparty%2Fdovecot%2Fcore.git dict-sql: Treat NULL value the same as "key not found" --- diff --git a/src/lib-dict/dict-sql.c b/src/lib-dict/dict-sql.c index 709fb210f6..aa82408782 100644 --- a/src/lib-dict/dict-sql.c +++ b/src/lib-dict/dict-sql.c @@ -465,6 +465,12 @@ sql_dict_lookup_async_callback(struct sql_result *sql_result, else if (result.ret > 0) { result.value = sql_dict_result_unescape_value(ctx->map, pool_datastack_create(), sql_result); + if (result.value == NULL) { + /* NULL value returned. we'll treat this as + "not found", which is probably what is usually + wanted. */ + result.ret = 0; + } } ctx->callback(&result, ctx->context);