Skip to content

[1.3.x] FAQs and Common Gotchyas

Andrew Krigline edited this page Jul 16, 2021 · 1 revision

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
Clone this wiki locally