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.2.25.rc1~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=923ed5836f90175e736846f02edfd9c2ee07dc6b;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 feb46a67c9..78df8e7dd1 100644 --- a/src/lib-dict/dict-sql.c +++ b/src/lib-dict/dict-sql.c @@ -478,6 +478,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);