diff --git a/src/bnetd/channel.cpp b/src/bnetd/channel.cpp index ed5773f98..fb66e2193 100644 --- a/src/bnetd/channel.cpp +++ b/src/bnetd/channel.cpp @@ -699,7 +699,7 @@ namespace pvpgn if (!((account_is_operator_or_admin(acc, channel_get_name(channel))) || (channel_conn_has_tmpVOICE(channel, me)) || (account_get_auth_voice(acc, channel_get_name(channel)) == 1))) { - message_send_text(me, message_type_error, me, localize(c, "This channel is moderated")); + message_send_text(me, message_type_error, me, localize(me, "This channel is moderated")); return; } } diff --git a/src/bnetd/i18n.cpp b/src/bnetd/i18n.cpp index 73a7e5f98..b98c63413 100644 --- a/src/bnetd/i18n.cpp +++ b/src/bnetd/i18n.cpp @@ -261,14 +261,16 @@ namespace pvpgn extern std::string _localize(t_connection * c, const char * func, const char * fmt, const fmt::ArgList &args) { - const char *format; + const char *format = fmt; std::string output(fmt); t_gamelang lang; + if (!c) { + eventlog(eventlog_level_error, __FUNCTION__, "got bad connection"); + return format; + } try { - format = fmt; - if (lang = conn_get_gamelang_localized(c)) if (!(format = _find_string(fmt, lang))) format = fmt; // if not found use original