Skip to content

Commit

Permalink
Make sure metadata objects are unique (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratacat authored and shawncplus committed Aug 10, 2019
1 parent db575bc commit 46715b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Character.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ class Character extends Metadatable(EventEmitter) {

// Arbitrary data bundles are free to shove whatever they want in
// WARNING: values must be JSON.stringify-able
this.metadata = data.metadata || {};
if (data.metadata) {
this.metadata = JSON.parse(JSON.stringify(data.metadata));
} else {
this.metadata = {};
}
}

/**
Expand Down

0 comments on commit 46715b7

Please sign in to comment.