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

Using BarChartDataSet default initializer causes a crash #734

Closed
natethegreat44 opened this issue Feb 3, 2016 · 3 comments
Closed

Using BarChartDataSet default initializer causes a crash #734

natethegreat44 opened this issue Feb 3, 2016 · 3 comments
Labels

Comments

@natethegreat44
Copy link

Hi,
I just tried using version 2.2.1 and my app crashed. I tracked it down to initializing BarChartDataSet with the default initializer.

i.e. in swift, BarChartDataSet(), or in objc [[BarChartDataSet alloc] init]

The error is:
fatal error: unexpectedly found nil while unwrapping an Optional value

Happens on line 57 of ChartDataSet.swift:
public var yVals: [ChartDataEntry] { return _yVals }

I love this library... thank you!
Nate

@liuxuan30
Copy link
Member

well.. You could use other init methods right now. seems _yVals is not inited if you simply call init()

@liuxuan30
Copy link
Member

@danielgindi the init method does not initialize _yVals in init() or init(label: String?)
so either we initialize them there, or we make _yVals have default value. What do you prefer

@liuxuan30
Copy link
Member

ah, why not use default values? same code twice.. maybe more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants