8000 Exception: EXC_BAD_INSTRUCTION When accessing nested relationship · Issue #25 · aronbalog/Vox · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Exception: EXC_BAD_INSTRUCTION When accessing nested relationship #25

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

Open
sadiq81 opened this issue Feb 13, 2019 · 1 comment
Open

Comments

@sadiq81
Copy link
sadiq81 commented Feb 13, 2019

When trying to access a nested object my app crashes

let baseURL = Environment.backendURL.appendingPathComponent("api")
            let dataSource = DataSource<ProductOfferResource>(strategy: .path(ProductOfferResource.resourceType), client: self.client)

            try! dataSource.fetch()
                    .result({ (document: Document<[ProductOfferResource]>) in
                                let productOffers = document.data
                                observer.onNext(productOffers ?? [])

                                // Causes crash
                                let background = productOffers?[0].design?.background_image?.meta 

                                observer.onCompleted()
                            }, { (error) in
                                observer.onError(error ?? NetworkServiceError.unknown)
                            })

All objects can be found https://gist.github.com/sadiq81/bf0e77a8561049ecd0a105479fc3ff5a

@sadiq81
Copy link
Author
sadiq81 commented Feb 13, 2019

screenshot 2019-02-13 at 12 17 33

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
0