commit 5d17ca7: [Minor] Allow nil as returned type

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Mar 1 11:07:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-03-01 11:05:04 +0000
URL: https://github.com/rspamd/rspamd/commit/5d17ca75aa180e424a4d53c1ffad31644170f096 (HEAD -> master)

[Minor] Allow nil as returned type

---
 src/lua/lua_config.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index 9d7f3341c..884467e10 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -1170,6 +1170,10 @@ lua_metric_symbol_callback (struct rspamd_task *task,
 			else if (type == LUA_TNUMBER) {
 				res = lua_tonumber (L, level + 1);
 			}
+			else if (type == LUA_TNIL) {
+				/* Can happen sometimes... */
+				res = FALSE;
+			}
 			else {
 				g_assert_not_reached ();
 			}


More information about the Commits mailing list