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

Crashes when searching for device that doesn't exist #60

Closed
kdawgwilk opened this issue Jan 4, 2017 · 2 comments
Closed

Crashes when searching for device that doesn't exist #60

kdawgwilk opened this issue Jan 4, 2017 · 2 comments

Comments

@kdawgwilk
Copy link
Contributor

We were using a older version of the library in our app and hadn't updated it in awhile and then the iPhone 7 came out and we still didn't update...It couldn't find the identifier in the list and so it attempted to try and guess it was a Simulator which it wasn't and so it crashed because of the force unwrap here it would be nice if the case where a device doesn't exist in the list that it didn't crash but returned a unknown device or handled things in a better way

@kdawgwilk
Copy link
Contributor Author

After looking at this some more I found that if you are looking up a Simulator identifier such a as x86_64 but on a real device such as iPhone 7 Plus it will crash because it is looking for getenv("SIMULATOR_MODEL_IDENTIFIER") which doesn't exist on a real device! So the library only supports looking up a Simulator identifier while running on a simulator. It would prob be a good idea to handle this case and provide a default Simulator identifier such as Simulator

@dennisweissmann
Copy link
Collaborator

Fixed by #61 and #62, thank you so much for contributing! 💯🎉🙏

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