commit f24be02: [Minor] Avoid comparing string with boolean

Alexander Moisseev moiseev at mezonplus.ru
Wed Apr 17 12:07:04 UTC 2019


Author: Alexander Moisseev
Date: 2019-04-17 10:43:22 +0300
URL: https://github.com/rspamd/rspamd/commit/f24be0299381702d7fa5ad4695f1c5debfad78a9 (refs/pull/2855/head)

[Minor] Avoid comparing string with boolean
when CT is not found

---
 src/plugins/lua/mime_types.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/lua/mime_types.lua b/src/plugins/lua/mime_types.lua
index e621b5666..04655beb0 100644
--- a/src/plugins/lua/mime_types.lua
+++ b/src/plugins/lua/mime_types.lua
@@ -1090,7 +1090,7 @@ local function check_mime_type(task)
           local detected_different = false
           if detected_ct and detected_ct ~= ct then
             local v_detected = map:get_key(detected_ct)
-	    if v_detected > v then v = v_detected end
+            if not v or v_detected and v_detected > v then v = v_detected end
             detected_different = true
           end
           if v then


More information about the Commits mailing list