diff --git a/src/proc/control/command-registry.hpp b/src/proc/control/command-registry.hpp index 956a732bd..5631a3120 100644 --- a/src/proc/control/command-registry.hpp +++ b/src/proc/control/command-registry.hpp @@ -103,7 +103,8 @@ namespace control { bool operator() (const Command *pC1, const Command *pC2) const { - return ( pC1 && pC2 && (*pC1 < *pC2)); + return (!pC1 && pC2) + || ( pC1 && pC2 && (*pC1 < *pC2)); } }; diff --git a/src/proc/control/command.cpp b/src/proc/control/command.cpp index b6cf35cdd..b786142ff 100644 --- a/src/proc/control/command.cpp +++ b/src/proc/control/command.cpp @@ -90,7 +90,8 @@ namespace control { static format fmt("Command \"%s\" not found"); if (!cmd) throw error::Invalid(str(fmt % cmdID), LUMIERA_ERROR_INVALID_COMMAND); - + + ENSURE (cmdID == CommandRegistry::instance().findDefinition(cmd)); return cmd; } diff --git a/src/proc/control/command.hpp b/src/proc/control/command.hpp index 1549c09db..82f5b5cc3 100644 --- a/src/proc/control/command.hpp +++ b/src/proc/control/command.hpp @@ -264,7 +264,8 @@ namespace control { inline bool operator< (Command const& c1, Command const& c2) { - return ( c1 && c2 && (&c1.impl() < &c2.impl())); + return (!c1 && c2) + || ( c1 && c2 && (&c1.impl() < &c2.impl())); }