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
Open
@sadiq81

Description

@sadiq81

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0