-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Provide an empty object when the target of the resolver is undefined #10655
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way to test this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd try to make sure _getTarget returns an objet (and that same object is returned on subsequent call)
If my thinking is right, this could happen when user is setting some value to config and if the object is not stored, the value will not be stored either.
@kurkle this is happening in annotation plugin when the user set a label to null in the configuration. |
@kurkle I spent time to have a look to the code. My knowledge of that code is quite low.
The 1, when a "main" resolver is created, the 2 when a sub resolver is created. The 1 sounds working correctly, returning the first scope The case of the bug is when a target (label) for a property (callout) is undefined. Following your suggestion, That's my analysis but maybe I have misunderstood and I'm wrong. I have changed the PR accordingly on what I wrote above. EDIT: I don't think we need any check to do in case 1 because I don't think we can create a resolver without any scope. |
@etimberg apologize I didn't read your comment. I'm trying to do it without annotation plugin. I'll come soon with a feedback |
@etimberg I have added test case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @stockiNail
I haven't had the time to go through this, but the added test looks solid.
@kurkle no problem at all! I was pleasure and mainly helpful because I was able to understand better the proxies implementation. ;) |
Fix #10654