Skip to contentSkip to conversation

event: Fix another 'if d' test to test for None explictly

PATCH New Richard Purdie 1 participant 1 message Mar 11, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 event: Fix another 'if d' test to test for None explictly

This should have been fixed in the previous patch, well spotted Chris!

---
 lib/bb/event.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/event.py +1 -1
index 22171a9ca5..31e7c2a4d2 100644
@@ -118,7 +118,7 @@ def fire_class_handlers(event, d):
             if _eventfilter:
                 if not _eventfilter(name, handler, event, d):
                     continue
-            if d and not name in (d.getVar("__BBHANDLERS_MC") or set()):
+            if d is not None and not name in (d.getVar("__BBHANDLERS_MC") or set()):
                 continue
             execute_handler(name, handler, event, d)
 
Signature · 1 line
2.27.0