Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecated accessors in swffg-main.js migration code #1086

Merged
merged 2 commits into from
Sep 10, 2022

Conversation

Esrin
Copy link
Collaborator

@Esrin Esrin commented Sep 10, 2022

No description provided.

Plus one null-safe fix in item-ffg.js
@Esrin Esrin requested a review from wrycu September 10, 2022 21:45
@Esrin
Copy link
Collaborator Author

Esrin commented Sep 10, 2022

@wrycu just to make you a bit more nervous about world migration 😂

@@ -119,7 +119,7 @@ export class ItemFFG extends ItemBaseFFG {

if (data?.itemattachment) {
data.itemattachment.forEach((attachment) => {
const activeModifiers = attachment.system.itemmodifier.filter((i) => i.system?.active);
const activeModifiers = attachment.system.itemmodifier?.filter((i) => i.system?.active);
Copy link
Collaborator Author

@Esrin Esrin Sep 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this error I was seeing is the result of a migration problem we'll need to tackle.

The attachment object we're looping through here isn't a real instance of an ItemData document, it's an array of our hacky deep embedded items... as such it doesn't have a .system. property if it's from an older item modifier that was added to an item pre-v10.

In the case I was seeing, the attachment object had data but not system, so this null check doesn't actually do anything.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I noticed that a few times.

@wrycu
Copy link
Collaborator

wrycu commented Sep 10, 2022

looks solid to me

@Esrin Esrin merged commit b614557 into foundry-10 Sep 10, 2022
@Esrin Esrin deleted the fix-v10-swffg-main-deprecations branch September 10, 2022 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants