mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 11:45:57 +08:00
Correct check that a translation is an object
typeof translation === 'object' returns true when translation is null
This commit is contained in:
parent
5e1978ceb7
commit
ff993c99a4
@ -51,7 +51,7 @@ export default class Translator {
|
||||
// If this translation has multiple options and a 'count' has been provided
|
||||
// in the input, we'll work out which option to choose using the `plural`
|
||||
// method.
|
||||
if (typeof translation === 'object' && typeof input.count !== 'undefined') {
|
||||
if (translation && typeof translation === 'object' && typeof input.count !== 'undefined') {
|
||||
translation = translation[this.plural(extractText(input.count))];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user