Skip to content

NullPointerException in ClassesHandler.getClass() when processing skill points (AdvancedSkills v1.6.29) #104

@Elbal00

Description

@Elbal00

Describe the bug

Hi,
I’m experiencing a critical error with AdvancedSkills v1.6.29 on Paper 1.21.11. The plugin throws a NullPointerException whenever a player loses a life from fall damage or when they kill a mob.

Description of the Problem
The error occurs during the EffectsActivateEvent, specifically:

java.lang.NullPointerException: Cannot invoke "java.util.Optional.isPresent()" because the return value of "net.advancedplugins.skills.classes.ClassesHandler.getClass(String)" is null
According to the stacktrace, the issue originates from:

SkillsHandler.processPoints(SkillsHandler.java:114)

ClassesHandler.getClass(String) returning null instead of an Optional

As a result, any action that should award skill points (fall damage, mob kills, etc.) triggers the error.

How to reproduce

Join the server with AdvancedSkills v1.6.29 installed.

Ensure the player has a skill profile (with or without a class assigned).

Perform one of the following actions:

Take fall damage and lose a life.

Kill any mob.

The console will immediately throw the NullPointerException.

This happens consistently every time.

Screenshots / Videos

No response

Server Log

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions