[1.3.x] FAQs and Common Gotchyas - League-of-Foundry-Developers/foundry-vtt-dnd5e-types GitHub Wiki
This is an extension of the foundry-vtt-types 0.8.x FAQs which I recommend reading first.
getData returns a Promise?
FormApplication#getData
can return a Promise. This makes extending a super.getData
tricky. In practice the 5e Actor and Item sheets do not return promises (usually), but it's simple to guard against it:
getData() {
const sheetData = super.getData();
if (sheetData instanceof Promise) {
// unexpected promise, returning early
return sheetData;
}
// do the rest of your normal stuff