Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Commit 59eb037

Browse files
committed
Small fix
1 parent 493e07b commit 59eb037

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

json-loader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ const jsonLoader = {
1515
loader.addDependency(filePath);
1616
var content = fs.readFileSync(filePath);
1717

18-
if (typeof options.namespace !== 'undefined') {
18+
if (options && typeof options.namespace !== 'undefined') {
1919
bundle[lang] = {};
2020
bundle[lang][options.namespace] = JSON.parse(content);
2121
} else {
2222
bundle[lang] = JSON.parse(content);
2323
}
2424

25-
if (typeof options.parameters !== "undefined") {
25+
if (options && typeof options.parameters !== "undefined") {
2626
bundle[lang] = this.replaceParameter(bundle[lang], options.parameters);
2727
}
2828
});

php-loader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const phpLoader = {
6060
console.warn('The file "' + file.path + '" could not be parsed', e.message);
6161
}
6262

63-
if (typeof options.namespace !== 'undefined') {
63+
if (options && typeof options.namespace !== 'undefined') {
6464
if (typeof bundle[directory] === 'undefined') {
6565
bundle[directory] = {};
6666
bundle[directory][options.namespace] = langObject
@@ -78,7 +78,7 @@ const phpLoader = {
7878
bundle[directory] = _.extend(bundle[directory], langObject);
7979
}
8080

81-
if (typeof options.parameters !== "undefined") {
81+
if (options && typeof options.parameters !== "undefined") {
8282
bundle[directory] = this.replaceParameter(bundle[directory], options.parameters);
8383
}
8484
}

0 commit comments

Comments
 (0)