Skip to content

Commit

Permalink
Merge pull request #1674 from obrenckle/fix_empty_mod_force_power
Browse files Browse the repository at this point in the history
fix(items): initialize data structure when needed
  • Loading branch information
wrycu authored Aug 14, 2024
2 parents bc2278e + a54635e commit f8cd79d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
* Imported skill modifiers have better formatted attributes key names ([#1663](https://github.com/StarWarsFoundryVTT/StarWarsFFG/issues/1663))
* Updated Spanish localizations

`1.903`
* Fix:
* Force Power: Empty mod list doesn't reset basic force power anymore

`1.903`
* Features:
* Updated "item cards" to match the Mandar theme
Expand Down
5 changes: 5 additions & 0 deletions modules/helpers/item-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ export default class ItemHelpers {
);
delete updatedData.data;
}
// Initialize updatedData.system if the key is present with no value
if (Object.keys(updatedData).includes('system') && typeof updatedData.system === "undefined")
{
updatedData.system = {};
}
return updatedData;
}
}

0 comments on commit f8cd79d

Please sign in to comment.