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

ASTraitCollection crash Inserting nil into dictionary #754

Open
ay8s opened this issue Jan 18, 2018 · 3 comments
Open

ASTraitCollection crash Inserting nil into dictionary #754

ay8s opened this issue Jan 18, 2018 · 3 comments

Comments

@ay8s
Copy link
Collaborator

ay8s commented Jan 18, 2018

Believe we're seeing a crash with the latest changes to ASTraitCollection.m in #625. a3136b0

I'm not sure when traits.preferredContentSizeCategory would be nil.

[props addObject:@{ @"preferredContentSizeCategory": (UIContentSizeCategory)traits.preferredContentSizeCategory }];

Edit: Looks to be on rotation of the device.

Just a heads up @ypogribnyi 👍

@nguyenhuy
Copy link
Member

@ypogribnyi Any idea why this is happening?

@ypogribnyi
Copy link
Contributor

I think it might be possible because of the improper initialization of ASPrimitiveCollectionTraits. I looked through the Texture sources, but haven't found any case of using it without initializing with ASPrimitiveTraitCollectionMakeDefault or ASPrimitiveTraitCollectionFromUITraitCollection().

My version is that this structure might be initialized by the application without using either of those functions and then be given to Texture (it's a struct after all, so zero-initialization is the default).

I tried to fix the crash in #757. @ay8s, can you test if it works for you?

@foxware00
Copy link
Contributor

@nguyenhuy I still seem to be facing this when creating logs call through to NSStringFromASPrimitiveTraitCollection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants