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

reference.adapt - handle undefined prop with updated AbstractDAO ID a… #3713

Merged
merged 2 commits into from
Feb 12, 2025

Conversation

jlhughes
Copy link
Collaborator

…dapt logic

@jlhughes jlhughes requested a review from kgrgreer February 12, 2025 18:52
@@ -1085,7 +1085,7 @@ foam.CLASS({
{
name: 'adapt',
value: function(oldValue, newValue, prop) {
return prop.of.isInstance(newValue) ?
return prop?.of.isInstance(newValue) ?
Copy link
Owner

Choose a reason for hiding this comment

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

Is this correct?
Should it be:
return (prop || foam.lang.FObject).of...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(prop || this) works to ensure we always call isInstance

@jlhughes jlhughes requested a review from kgrgreer February 12, 2025 19:03
@kgrgreer kgrgreer merged commit cc4dc64 into development Feb 12, 2025
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