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

Fixes bug accessing the PHPhotoLibrary #282

Merged
merged 1 commit into from Apr 14, 2016

Conversation

danthorpe
Copy link
Member

This was not getting trigged in unit tests, because the registrar property is lazy. And for all tests we replace the actual registrar object (in this case the PHPhotoLibrary) with a testable equivalent.

This means that the init() of PHPhotoLibrary was never called - and it turns out that it hits a run time exception.

This is exactly the sort of bug that Swift prevents, as if PHPhotoLibrary were written in Swift, the code would not have even compiled.

This fixes #280.

This was not getting trigged in unit tests, because the registrar property is lazy. And for all tests we replace the actual registrar object (in this case the PHPhotoLibrary) with a testable equivalent.

This means that the init() of PHPhotoLibrary was never called - and it turns out that it hits a run time exception.

This is exactly the sort of bug that Swift prevents, as if PHPhotoLibrary were written in Swift, the code would not have even compiled.
@danthorpe danthorpe added this to the 2.10.0 milestone Apr 14, 2016
@danthorpe danthorpe merged commit 6ff1837 into development Apr 14, 2016
@danthorpe danthorpe deleted the feature/OPR-280_fix_photos_registrar branch April 15, 2016 17:33
danthorpe added a commit that referenced this pull request Apr 18, 2016
This was not getting trigged in unit tests, because the registrar property is lazy. And for all tests we replace the actual registrar object (in this case the PHPhotoLibrary) with a testable equivalent.

This means that the init() of PHPhotoLibrary was never called - and it turns out that it hits a run time exception.

This is exactly the sort of bug that Swift prevents, as if PHPhotoLibrary were written in Swift, the code would not have even compiled.
@danthorpe danthorpe modified the milestones: 3.0, 2.10.0 Apr 26, 2016
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

Successfully merging this pull request may close these issues.

Crash when adding Capability.Photos() condition
1 participant