Add check to prevent null exceptions to isAdmin function
This commit is contained in:
1 parent
4ca4fa7dba
commit
3bccd6ce5a
2 files changed
+3
-2
No files matched your search
@@ -138,7 +138,6 @@ public class MysqlDatabase {
|
||||
* @return a ResultSet object, which can be converted to a model using {@link MysqlDatabase#convertToTableModel(ResultSet, String)}
|
||||
*/
|
||||
protected synchronized ResultSet prepareAndExecute(String sql, Object... params) {
|
||||
logger.debug(sql);
|
||||
|
||||
try {
|
||||
PreparedStatement query = connection.prepareStatement(sql);
|
||||
|
||||
@@ -3,13 +3,15 @@ package netneutrality.utils;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.Role;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
|
||||
public class UserFunction {
|
||||
|
||||
public static boolean isAdmin(Member user) {
|
||||
|
||||
// This check will only be present during the development of the bot
|
||||
if (user.getUser().getId().equals(Settings.getInstance().getCreator().getId())) {
|
||||
User creator = Settings.getInstance().getCreator();
|
||||
if (creator != null && user.getId().equals(creator.getId())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user