* maint: Don't crash when a response is not defined Quiet a clang warning Conflicts: src/crypto/bf_util.cc src/response.cc
@@ -22,6 +22,7 @@
* Bots now share channel key to other bots even if not opped.
* Fix rare issue with writing binary config.
* Make ./wraith -q and -Q clearly exit when already written.
+ * Don't crash when looking up a missing response.
# 1.4.9
* Fix various compile warnings and spam
@@ -25,6 +25,8 @@ init_responses()
const char *
response(response_t type)
{
+ if (!res_map.contains(type))
+ return type;
return res_map[type][randint(res_map[type].size())];
}
/* vim: set sts=2 sw=2 ts=8 et: */