2
The code I’m using is this:
public ForumGroups getMainGroup() {
if (Constants.SQL_ENABLED) {
int lowest = -1;
ForumGroups g = null;
for (ForumGroup group : forumGroups) {
if (group.getGroup().ordinal() < lowest || g == null) {
lowest = group.getGroup().ordinal();
g = group.getGroup();
}
}
if (g == null)
return ForumGroups.MEMBER;
else
return g;
}
return ForumGroups.OWNER;
}
And I’m getting error on this line
if (group.getGroup().ordinal() < lowest || g == null) {
What I do?
mistake here:
java.lang.NullPointerException
at ophion.rs.game.player.Player.getMainGroup(Player.java:4118)
at ophion.rs.game.player.Player.InterfaceManager$3.run(InterfaceManager.java:472)
at ophion.rs.game.tasks.WorldTasksManager.processTasks(WorldTasksManager.java:18)
post the error stacktrace to make it easier to help...
– Pedro Laini
What object is the
group
? Without other relevant parts it is difficult to help.– Maniero
not so... post in your question the stacktrace
– Pedro Laini
I’m new at this kk sorry
– Wyvern
Run a debug there probably the group.getGroup(). ordinal() method is returning a NULL. Debugging and checking the group object, you may be able to detect the error.
– Celso Marigo Jr
I’ve been around but I can’t detect you, what I do?
– Wyvern