team172011 / TAcharting

A charing application to download, plott and analyse securities, indicators, strategies and trading records
Other
62 stars 18 forks source link

NullPointerException #14

Open benmccann opened 6 years ago

benmccann commented 6 years ago

I typed in a ticker and pressed "Add"

21:33:28.736 [JavaFX Application Thread] DEBUG o.s.t.c.controller.ChartController - Start Yahoo request...
21:33:30.674 [Thread-5] DEBUG o.s.t.c.a.YahooService$CrumbManager - Set cookie from http request: B=0h14n59d7fr59&b=3&s=en
21:33:31.025 [Thread-5] DEBUG o.s.t.c.a.YahooService$CrumbManager - Set crumb from http request: Q4YyQzQoG6o
java.lang.NullPointerException
    at org.sjwimmer.tacharting.chart.model.types.YahooTimePeriod.of(YahooTimePeriod.java:35)
    at org.sjwimmer.tacharting.chart.api.CSVConnector.getSeriesFromYahooFile(CSVConnector.java:102)
    at org.sjwimmer.tacharting.chart.api.YahooService$RequestTimeSeries.call(YahooService.java:150)
    at org.sjwimmer.tacharting.chart.api.YahooService$RequestTimeSeries.call(YahooService.java:69)
    at javafx.concurrent.Task$TaskCallable.call(Task.java:1423)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at javafx.concurrent.Service.lambda$null$492(Service.java:725)
    at java.security.AccessController.doPrivileged(Native Method)
    at javafx.concurrent.Service.lambda$executeTask$493(Service.java:724)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
team172011 commented 6 years ago

I think this happens if there is no properties file for api/yahoo. Can you click Api Settings -> Yahoo and than save. This will create the api.properties file in home/tachart/properties

benmccann commented 6 years ago

It seems like the better behavior if this file is missing would be to create it rather than throwing an error. Why should the user have to know to press Api Settings -> Yahoo -> save the first time they use the app?

team172011 commented 6 years ago

Sure, this was not planed to be the default way. I will fix it soon. But I want to merge other changes before