main: don't insert null function pointers into the legacy commands map

This is purely aesthetically bothering me, but [] inserting stuff into
the map is such a C++ coded design decision and we don't intend to
mutate it here so we probably should not do it.

Change-Id: Idf37c51175b031fb396e8fd53dc8fe6f2039fb55
This commit is contained in:
Jade Lovelace
2026-07-13 19:51:09 +02:00
committed by rootile
parent 782d967342
commit fca58aa044
+2 -2
View File
@@ -488,9 +488,9 @@ int mainWrapped(AsyncIoRoot & aio, int argc, char ** argv)
{
registerLegacyCommands();
auto legacy = (*LegacyCommandRegistry::commands)[programName];
auto legacy = nix::get(*LegacyCommandRegistry::commands, programName);
if (legacy) {
return legacy(
return (*legacy)(
aio,
std::string(baseNameOf(argv[0])),
Strings(argv + 1, argv + argc),