{"action":"created","issue":{"url":"https://api.github.com/repos/netguru/ngrvalidator/issues/4","labels_url":"https://api.github.com/repos/netguru/ngrvalidator/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/netguru/ngrvalidator/issues/4/comments","events_url":"https://api.github.com/repos/netguru/ngrvalidator/issues/4/events","html_url":"https://github.com/netguru/ngrvalidator/issues/4","id":58554887,"number":4,"title":"Passing nil as error to validateModel:error:usingRules: method crashes","user":{"login":"WojciechTrzasko","id":1029858,"avatar_url":"https://avatars.githubusercontent.com/u/1029858?v=3","gravatar_id":"","url":"https://api.github.com/users/WojciechTrzasko","html_url":"https://github.com/WojciechTrzasko","followers_url":"https://api.github.com/users/WojciechTrzasko/followers","following_url":"https://api.github.com/users/WojciechTrzasko/following{/other_user}","gists_url":"https://api.github.com/users/WojciechTrzasko/gists{/gist_id}","starred_url":"https://api.github.com/users/WojciechTrzasko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WojciechTrzasko/subscriptions","organizations_url":"https://api.github.com/users/WojciechTrzasko/orgs","repos_url":"https://api.github.com/users/WojciechTrzasko/repos","events_url":"https://api.github.com/users/WojciechTrzasko/events{/privacy}","received_events_url":"https://api.github.com/users/WojciechTrzasko/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-23T08:04:17Z","updated_at":"2015-02-23T09:06:57Z","closed_at":"2015-02-23T08:39:52Z","body":"When I use `validateModel:error:usingRules:` method like this:\r\n```obj-c\r\n[NGRValidator validateModel:self.mailTextField error:nil usingRules:^NSArray * {\r\n        return @[NGRValidate(@\"text\").required()];\r\n    }];\r\n```\r\nlibrary crashes in `validateModel:error:usingRules:` method on line:\r\n`if (validationError && *error == NULL) {`.\r\n\r\nIs this desired result and I shouldn't pass `nil` to that method? If yes can you update documentation to contains this information?"},"comment":{"url":"https://api.github.com/repos/netguru/ngrvalidator/issues/comments/75508942","html_url":"https://github.com/netguru/ngrvalidator/issues/4#issuecomment-75508942","issue_url":"https://api.github.com/repos/netguru/ngrvalidator/issues/4","id":75508942,"user":{"login":"PatrykKaczmarek","id":3520281,"avatar_url":"https://avatars.githubusercontent.com/u/3520281?v=3","gravatar_id":"","url":"https://api.github.com/users/PatrykKaczmarek","html_url":"https://github.com/PatrykKaczmarek","followers_url":"https://api.github.com/users/PatrykKaczmarek/followers","following_url":"https://api.github.com/users/PatrykKaczmarek/following{/other_user}","gists_url":"https://api.github.com/users/PatrykKaczmarek/gists{/gist_id}","starred_url":"https://api.github.com/users/PatrykKaczmarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PatrykKaczmarek/subscriptions","organizations_url":"https://api.github.com/users/PatrykKaczmarek/orgs","repos_url":"https://api.github.com/users/PatrykKaczmarek/repos","events_url":"https://api.github.com/users/PatrykKaczmarek/events{/privacy}","received_events_url":"https://api.github.com/users/PatrykKaczmarek/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T09:06:57Z","updated_at":"2015-02-23T09:06:57Z","body":"Hello\r\n\r\nThanks for reporting an issue. I fixed that problem in version `0.4.2`. \r\n\r\nJust a hint: to validate single value, like `text` from `UITextField` in your case please rather use:\r\n```\r\n+ (NSError *)validateValue:(NSObject *)value named:(NSString *)name usingRules:(void (^)(NGRPropertyValidator *validator))rules;\r\n```\r\nto avoid unnecessary reflecting `UITextField` class and its properties.\r\n"}}