diff --git a/bundles/ng2-translate.js b/bundles/ng2-translate.js index 45dca6f9..1857182d 100644 --- a/bundles/ng2-translate.js +++ b/bundles/ng2-translate.js @@ -82,7 +82,7 @@ System.registerDynamic("src/translate.pipe", ["angular2/core", "./translate.serv }; TranslatePipe.prototype.transform = function(query, args) { var _this = this; - if (query.length === 0) { + if (!query || query.length === 0) { return query; } if (this.equals(query, this.lastKey) && this.equals(args, this.lastParams)) { diff --git a/src/translate.pipe.ts b/src/translate.pipe.ts index bf80466a..8bda86bf 100644 --- a/src/translate.pipe.ts +++ b/src/translate.pipe.ts @@ -76,7 +76,7 @@ export class TranslatePipe implements PipeTransform, OnDestroy { } transform(query: string, args: any[]): any { - if(query.length === 0) { + if(!query || query.length === 0) { return query; } // if we ask another time for the same key, return the last value