Skip to content

Commit

Permalink
fixed error when updating objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Jan 27, 2023
1 parent 55ce066 commit 0eb6e34
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,10 +631,12 @@ class TaggerHandler {
let propertyName = CONSTANTS.TAG_PROPERTY;
if (inDocument instanceof Actor) propertyName = "prototypeToken." + propertyName;
let tags = getProperty(updateData, propertyName);
tags = Tagger._validateTags(tags, "_applyTags");
if(!tags.length){
if(tags === undefined) return;
if(!tags?.length){
propertyName = propertyName.replace(CONSTANTS.TAG_PROPERTY, CONSTANTS.REMOVE_TAG_PROPERTY);
tags = null;
}else{
tags = Tagger._validateTags(tags, "_applyTags");
}
setProperty(updateData, propertyName, tags);
}
Expand Down

0 comments on commit 0eb6e34

Please sign in to comment.