Fix possible crash with outputPrefix when module is not loaded properly [#462]

This commit is contained in:
reality 2013-05-26 12:42:49 +00:00
parent 1e2a823ef2
commit a851a2bee4

2
run.js
View File

@ -97,7 +97,7 @@ DBot.prototype.t = function(string, formatData) {
if(_.has(this.strings[string], lang)) { if(_.has(this.strings[string], lang)) {
var module = this.stringMap[string]; var module = this.stringMap[string];
formattedString = this.strings[string][lang].format(formatData); formattedString = this.strings[string][lang].format(formatData);
if(this.config[module].outputPrefix) { if(this.config[module] && this.config[module].outputPrefix) {
formattedString = '[' + this.config[module].outputPrefix + '] ' + formattedString = '[' + this.config[module].outputPrefix + '] ' +
formattedString; formattedString;
} }