diff --git a/module/actor-sheet.js b/module/actor-sheet.js index 06649da..e31b543 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -120,6 +120,7 @@ export class SimpleActorSheet extends ActorSheet { const formAttrs = expandObject(formData).data.attributes || {}; const attributes = Object.values(formAttrs).reduce((obj, v) => { let k = v["key"].trim(); + if ( /[\s\.]/.test(k) ) return ui.notifications.error("Attribute keys may not contain spaces or periods"); delete v["key"]; obj[k] = v; return obj; diff --git a/module/item-sheet.js b/module/item-sheet.js index 1d6b99e..d02cea3 100644 --- a/module/item-sheet.js +++ b/module/item-sheet.js @@ -104,6 +104,7 @@ export class SimpleItemSheet extends ItemSheet { const formAttrs = expandObject(formData).data.attributes || {}; const attributes = Object.values(formAttrs).reduce((obj, v) => { let k = v["key"].trim(); + if ( /[\s\.]/.test(k) ) return ui.notifications.error("Attribute keys may not contain spaces or periods"); delete v["key"]; obj[k] = v; return obj;