Fix settings panel bug NPE.

The parent needs to be set before it can be used.
This commit is contained in:
tastybento 2024-01-11 14:38:45 +09:00
parent be9b429308
commit edd7bcfbd2

View File

@ -54,9 +54,8 @@ public class SettingsTab implements Tab, ClickHandler {
*/
public SettingsTab(User user, Type type) {
this.user = user;
this.island = parent.getIsland();
this.type = type;
this.world = island.getWorld();
// Island and world are set when the parent is set.
}
/**
@ -234,6 +233,9 @@ public class SettingsTab implements Tab, ClickHandler {
@Override
public void setParentPanel(TabbedPanel parent) {
this.parent = parent;
this.island = parent.getIsland();
this.world = island.getWorld();
}
}