Explorar el Código

delegate: just an extra safe check

Michele Caini hace 3 años
padre
commit
bdaeef856d
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      src/entt/signal/delegate.hpp

+ 1 - 0
src/entt/signal/delegate.hpp

@@ -218,6 +218,7 @@ public:
      * @param payload User defined arbitrary data.
      */
     void connect(function_type *function, const void *payload = nullptr) noexcept {
+        ENTT_ASSERT(function != nullptr, "Uninitialized function pointer");
         instance = payload;
         fn = function;
     }