Skip to content

Commit

Permalink
ignore non valid keys in saveMissing
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Nov 19, 2019
1 parent 3130cd6 commit 0563aaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/BackendConnector.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ class Connector extends EventEmitter {
return;
}

// ignore non valid keys
if (key === undefined || key === null || key === '') return;

if (this.backend && this.backend.create) {
this.backend.create(languages, namespace, key, fallbackValue, null /* unused callback */, {
...options,
Expand Down
2 changes: 1 addition & 1 deletion src/Translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Translator extends EventEmitter {
if (!options) options = {};

// non valid keys handling
if (keys === undefined || keys === null) return '';
if (keys === undefined || keys === null/* || keys === ''*/) return '';
if (!Array.isArray(keys)) keys = [String(keys)];

// separators
Expand Down

0 comments on commit 0563aaa

Please sign in to comment.