Check extracted is an instance of TranslationCollection before merging

This commit is contained in:
Kim Biesbjerg 2019-09-17 14:15:21 +02:00
parent 096fc79a9b
commit 16bf5f59e0

View File

@ -107,7 +107,7 @@ export class ExtractTask implements TaskInterface {
const contents: string = fs.readFileSync(path, 'utf-8');
this.parsers.forEach(parser => {
const extracted = parser.extract(contents, path);
if (extracted) {
if (extracted instanceof TranslationCollection) {
collection = collection.union(extracted);
}
});