From c46f690d431ad845eee48890fa295ca05b8c4e72 Mon Sep 17 00:00:00 2001 From: Benjamin Rosenberger Date: Thu, 2 Jun 2016 14:30:47 +0200 Subject: [PATCH] [Issue#87] fix target undefined for missing translation --- src/translate.parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/translate.parser.ts b/src/translate.parser.ts index fbae1a23..040d5729 100644 --- a/src/translate.parser.ts +++ b/src/translate.parser.ts @@ -32,7 +32,7 @@ export class Parser { key = ''; do { key += keys.shift(); - if (target[key] !== undefined && (typeof target[key] === 'object' || !keys.length)) { + if (target!==undefined && target[key] !== undefined && (typeof target[key] === 'object' || !keys.length)) { target = target[key]; key = ''; } else if (!keys.length) {