-
Notifications
You must be signed in to change notification settings - Fork 8
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
NR-359870 fix for the attribute validator crash #340
Conversation
…and used anywhere it's needed
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.
The attribute validator doesn't need to be made static. The appropriate way to do this, if it's going to be the same attribute validator, would be to create a class that conforms to the AttributeValidator protocol
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.
Looks good to me 👍
I think this is okay use of static. |
… try to address concerns.
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.
This is not the way that class is meant to be used.
…'s it's own class
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.
LGTM
@@ -71,6 +74,8 @@ - (instancetype) initWithAnalyticsController:(NRMAAnalytics*)analytics | |||
self = [super init]; | |||
if (self) { | |||
analyticsParent = analytics; | |||
|
|||
_attributeValidator = [[NRMAAttributeValidator alloc] init]; |
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.
If you pass something that conforms to the AttributeValidator protocol in as a parameter to this class, then you can replace it for testing.
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.
Made the change to move it to be passed in.
…ndled exception, so it can be replaced for testing
a47828e
Moved the attribute validator to utils so it can be static and used anywhere it's needed