TAcharting icon indicating copy to clipboard operation
TAcharting copied to clipboard

NullPointerException

Open benmccann opened this issue 7 years ago • 3 comments

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)

benmccann avatar Feb 05 '18 05:02 benmccann

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

team172011 avatar Feb 05 '18 11:02 team172011

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?

benmccann avatar Feb 19 '18 22:02 benmccann

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

team172011 avatar Feb 19 '18 22:02 team172011