diff options
Diffstat (limited to 'ext/bg/js/util.js')
-rw-r--r-- | ext/bg/js/util.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js index f44ffbc8..a0fca270 100644 --- a/ext/bg/js/util.js +++ b/ext/bg/js/util.js @@ -103,6 +103,14 @@ function buildTag(name, meta) { tag[prop] = meta[symbol][prop]; } + return sanitizeTag(tag); +} + +function sanitizeTag(tag) { + tag.name = tag.name || 'untitled'; + tag.category = tag.category || 'default'; + tag.notes = tag.notes || ''; + tag.order = tag.order || 0; return tag; } |