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

NPE when fleet has been removed from starmap #60

Closed
tuomount opened this issue Jun 29, 2017 · 1 comment
Closed

NPE when fleet has been removed from starmap #60

tuomount opened this issue Jun 29, 2017 · 1 comment
Assignees
Labels
bug Verified bug which needs fixing

Comments

@tuomount
Copy link
Owner

There is possible NPE when fleet has been removed but it is still in fleetMap.

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.openRealmOfStars.gui.mapPanel.MapPanel.drawMap(MapPanel.java:421)
at org.openRealmOfStars.game.States.StarMapView.handleActions(StarMapView.java:302)
at org.openRealmOfStars.game.Game.actionPerformed(Game.java:951)

@tuomount tuomount added the bug Verified bug which needs fixing label Jun 29, 2017
@tuomount tuomount self-assigned this Jun 29, 2017
@tuomount
Copy link
Owner Author

Fixed with simple null check:
if (fleet != null && info.getSectorCloakDetection(i + cx, j + cy)
>= fleet.getFleetCloackingValue()) {

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

No branches or pull requests

1 participant