MileStone 2 : NullPointerException while using stockQuoteService.getStockQuote in PortfolioManagaerIMPL

The error comes when I try to check dashboard.py results on the terminal,
the build gets successful and all test cases are running fine (except 3 of Alphantage which have to implemented on milestone3)

PS: Used StockQuoteServiceFactory.INSTANCE.getService in portfolioManagerFactory

Hi @TanG,

It is possible this error is coming is because the app maybe using a null string to run and since you haven’t implemented AlphaVantage yet, you cannot return an object of that type when null is passed to provider string when you are selecting the API service to be used.

I’ll recommend you implement AlphaVantage and make sure you explicitly check if provider string is null to return an object of that type, as it is something that many of us were stuck on. You may then try running the dashboard.

Alternatively, you can use default arguments in the method where you return the API service for the time being and set it to tiingo so that it functions right now. I did not try this approach but I don’t think you should have an issue with this.

Let me know if this works!

I’m closing this topic due to no response from anyone since last 12 hours. If your query is resolved you can mark any reply as a solution. If you still have the query, please create a new topic paste the link of this topic in the description.