forked from GitHub/dbot
Fix possible crash with outputPrefix when module is not loaded properly [#462]
This commit is contained in:
parent
1e2a823ef2
commit
a851a2bee4
2
run.js
2
run.js
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user