const MonCommand *leader_cmd;
const auto& mgr_cmds = mgrmon()->get_command_descs();
- const MonCommand *mgr_cmd = _get_moncommand(prefix, &mgr_cmds.at(0),
- mgr_cmds.size());
+ const MonCommand *mgr_cmd = nullptr;
+ if (!mgr_cmds.empty()) {
+ mgr_cmd = _get_moncommand(prefix, &mgr_cmds.at(0), mgr_cmds.size());
+ }
leader_cmd = _get_moncommand(prefix,
// the boost underlying this isn't const for some reason
const_cast<MonCommand*>(leader_supported_mon_commands),