|
@@ -17,6 +17,8 @@ import com.gmail.nossr50.util.Misc;
|
|
import org.apache.tomcat.jdbc.pool.DataSource;
|
|
import org.apache.tomcat.jdbc.pool.DataSource;
|
|
import org.apache.tomcat.jdbc.pool.PoolProperties;
|
|
import org.apache.tomcat.jdbc.pool.PoolProperties;
|
|
import org.bukkit.scheduler.BukkitRunnable;
|
|
import org.bukkit.scheduler.BukkitRunnable;
|
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
|
+import org.jetbrains.annotations.Nullable;
|
|
|
|
|
|
import java.sql.*;
|
|
import java.sql.*;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -344,11 +346,11 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|
return success;
|
|
return success;
|
|
}
|
|
}
|
|
|
|
|
|
- public List<PlayerStat> readLeaderboard(PrimarySkillType skill, int pageNumber, int statsPerPage) throws InvalidSkillException {
|
|
|
|
|
|
+ public @NotNull List<PlayerStat> readLeaderboard(@Nullable PrimarySkillType skill, int pageNumber, int statsPerPage) throws InvalidSkillException {
|
|
List<PlayerStat> stats = new ArrayList<>();
|
|
List<PlayerStat> stats = new ArrayList<>();
|
|
|
|
|
|
//Fix for a plugin that people are using that is throwing SQL errors
|
|
//Fix for a plugin that people are using that is throwing SQL errors
|
|
- if(skill.isChildSkill()) {
|
|
|
|
|
|
+ if(skill != null && skill.isChildSkill()) {
|
|
mcMMO.p.getLogger().severe("A plugin hooking into mcMMO is being naughty with our database commands, update all plugins that hook into mcMMO and contact their devs!");
|
|
mcMMO.p.getLogger().severe("A plugin hooking into mcMMO is being naughty with our database commands, update all plugins that hook into mcMMO and contact their devs!");
|
|
throw new InvalidSkillException("A plugin hooking into mcMMO that you are using is attempting to read leaderboard skills for child skills, child skills do not have leaderboards! This is NOT an mcMMO error!");
|
|
throw new InvalidSkillException("A plugin hooking into mcMMO that you are using is attempting to read leaderboard skills for child skills, child skills do not have leaderboards! This is NOT an mcMMO error!");
|
|
}
|
|
}
|