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

Crashing calling Device.current.safeDescription #278

Open
bladebunny opened this issue Mar 26, 2021 · 1 comment
Open

Crashing calling Device.current.safeDescription #278

bladebunny opened this issue Mar 26, 2021 · 1 comment

Comments

@bladebunny
Copy link

bladebunny commented Mar 26, 2021

Internally Device.identifier is failling and Device.current returns an invalid pointer. Device.current.safeDescription then crashes because it doesn't handle the failure or throw. It seem like this should really throw or return an optional.

This occurred on an iPhone 11 Pro sim. Tried with both v.4.0.0 and latest (4.3.0). We use in a lib that we distribute internally. And I'm looking at an issue where another group wraps our lib in their own lib within their app. So the dependency graph looks like: App -> theirLib -> ourLib -> DeviceKit

Seeing if i can work out a solution with a local copy.
Thank you!

@bladebunny
Copy link
Author

bladebunny commented Mar 26, 2021

Some additional follow up: identifier is returning "x86_64". ProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"] finds "iPhone12,3" but the result of calling back into mapToDevice, even though its a valid case, is returning "invalid". And the call to simulator(mapping) is also invalid. So, for whatever reason, iPhone11Pro comes back as invalid. Seems like the recursive look up on the enum is failing for some reason.

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

1 participant