Fix NPEs from BoostsPlugin at startup
shownSkills wasn't being initialized until it received ConfigChanged event, causing a NullPointerException when the overlay tried to iterate over shownSkills
This commit is contained in:
@@ -84,6 +84,15 @@ public class BoostsPlugin extends Plugin
|
|||||||
return boostsOverlay;
|
return boostsOverlay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void startUp()
|
||||||
|
{
|
||||||
|
if (config.enabled())
|
||||||
|
{
|
||||||
|
updateShownSkills(config.enableSkill());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onConfigChanged(ConfigChanged event)
|
public void onConfigChanged(ConfigChanged event)
|
||||||
{
|
{
|
||||||
@@ -92,14 +101,7 @@ public class BoostsPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.enableSkill())
|
updateShownSkills(config.enableSkill());
|
||||||
{
|
|
||||||
shownSkills = ObjectArrays.concat(COMBAT, SKILLING, Skill.class);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
shownSkills = COMBAT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.getKey().equals("displayIndicators"))
|
if (event.getKey().equals("displayIndicators"))
|
||||||
{
|
{
|
||||||
@@ -121,4 +123,16 @@ public class BoostsPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateShownSkills(boolean showSkillingSkills)
|
||||||
|
{
|
||||||
|
if (showSkillingSkills)
|
||||||
|
{
|
||||||
|
shownSkills = ObjectArrays.concat(COMBAT, SKILLING, Skill.class);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
shownSkills = COMBAT;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user