Matthew-Bunge-Software / Board-Game-Recs

Board Game Data Visualization and Recommendation
2 stars 1 forks source link

Null pointer exception on non-existent game. #21

Closed mattb555 closed 4 years ago

mattb555 commented 4 years ago

For example, api call on ID=156888 will throw a null pointer exception because there's nothing at the endpoint with that ID.

kundan13kumar2 commented 4 years ago

I want to pick this issue.

kundan13kumar2 commented 4 years ago

Which API are you talking about? As I am seeing here, there are below controllers with url: /api/test /api/getOverview /terms Can you please elaborate more about this issue?

mattb555 commented 4 years ago

Here's the relevant stack trace:

java.lang.NullPointerException: null
        at org.bunge.bgginfo.bggintegration.model.BGGPayloadSearchResults.toString(BGGPayloadSearchResults.java:31) ~[main/:na]
        at org.bunge.bgginfo.bggintegration.service.DefaultBGGService.getRandomGameTerms(DefaultBGGService.java:37) ~[main/:na]
        at org.bunge.bgginfo.scheduled.ScheduledTasks.queryApi(ScheduledTasks.java:25) ~[main/:na]

To explain, every 3 seconds queryApi makes a call to getRandomGameTerms which makes an API call to BGG in the form:

https://www.boardgamegeek.com/xmlapi2/thing?id={id}&stats=1

Sometimes, this causes a null pointer error in the Logging when {id} is a number that doens't exist on BGG's end. (For example try clicking here vs here. Based on this error log, it's becaue model.BGGPayloadSearchResults.toString has a null pointer exception.

kundan13kumar2 commented 4 years ago

can you please give access to push my commits? getting error as : git push origin nullgame#21 remote: Permission to Matthew-Bunge-Software/Board-Game-Recs.git denied to kundan13kumar2. fatal: unable to access 'https://github.com/Matthew-Bunge-Software/Board-Game-Recs.git/': The requested URL returned error: 403

mattb555 commented 4 years ago

This issue has been made redundant by another PR.

In the future @kundan13kumar2 , the normal procedure for contributing to any repo that you don't own is to create your own personal fork of it, make the changes you want in that fork, and then open a pull request back to the original. At that time a maintainer (for example, me) will review the changes and then either approve/deny or request additional changes.

For more info, here's a good tutorial: https://gist.github.com/Chaser324/ce0505fbed06b947d962