🐛 Serialisation d'une unité nulle

Corrige #737
pull/736/head
Maxime Quandalle 2019-10-17 09:12:13 +02:00
parent 6440b3fad4
commit f67098a29b
No known key found for this signature in database
GPG Key ID: 428641C03D29CA10
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ let printUnits = (units, count) =>
const plural = 2
export let serialiseUnit = (rawUnit, count = plural, lng = undefined) => {
if (typeof rawUnit !== 'object') {
if (rawUnit === null || typeof rawUnit !== 'object') {
return typeof rawUnit === 'string'
? i18n.t(`units:${rawUnit}`, { count, lng })
: rawUnit