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

Guard against NULL issue in default mapper #34

Closed
vokal-isaac opened this issue Apr 7, 2015 · 5 comments
Closed

Guard against NULL issue in default mapper #34

vokal-isaac opened this issue Apr 7, 2015 · 5 comments
Assignees

Comments

@vokal-isaac
Copy link
Contributor

It's in or around

        Class managedObjectClass = objc_getClass(className);
        objc_property_t prop = class_getProperty(managedObjectClass, propertyName);

        NSString *attributeString = [NSString stringWithCString:property_getAttributes(prop) encoding:NSUTF8StringEncoding];

in expectedClassForObject:andKey:. (I think it's that prop is NULL and then property_getAttributes(prop) crashes.)

@designatednerd
Copy link
Contributor

@vokal-isaac Would you consider this addressed by #49?

@vokal-isaac
Copy link
Contributor Author

Maybe? #49 sticks an assertion on that, so it'll give useful information in debugging, but it'll still crash here in a release build. I'm not sure I can think of a sane set of circumstances that would cause this to happen in a release build and not in a debug build, but I haven't tried too hard yet.

@designatednerd
Copy link
Contributor

@vokal-isaac I'm inclined to close this one out unless it crops its ugly head up again. Agreed?

@vokal-isaac
Copy link
Contributor Author

Assign it to me (_edit_ I can't actually assign it, since I don't own this repo) and I'll spend a bit of time actually thinking about it today, and either close it based on what's already done or implement a resolution.

@designatednerd
Copy link
Contributor

@vokal-isaac: Done. I think you should at least be able to close it from here.

vokal-isaac added a commit to vokal-isaac/Vokoder that referenced this issue Oct 23, 2015
Avoid production crashes with additional safety around failure to get a property and/or failure to get a class.  (Programmer-error cases are already covered by assertions.)
designatednerd added a commit that referenced this issue Oct 23, 2015
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

No branches or pull requests

2 participants