Skip to content

Parsing fails if no FI data  #4

Description

@jonlidgard

Some ofx files do not include FI information (e.g. Barclays Bank). Following code in Finance.swift makes FI parsing optional
/// Information about the entity which provided the OFX file.
public struct Institute: Information {
static let label: String = "FI"

/// The name of the institution.
public var name: String = ""

/// An identifier for this specific institution.
public var id: Identifier = ""

init?(parent element: Element) {
if let element = element[Institute.label] {
name = element["ORG"]?.content ?? ""
id = element["FID"]?.content ?? ""
}
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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