Guard against missing YAML sections in FileManager #1

Closed
NotAlexNoyle wants to merge 1 commits from codex/fix-nullpointerexception-in-tabcompletefilter into master
pull from: codex/fix-nullpointerexception-in-tabcompletefilter
NotAlexNoyle commented 2026-03-24 11:31:57 -04:00 (Migrated from github.com)

Motivation

  • Prevent a startup NullPointerException caused by dereferencing missing YAML sections in args.yml or config.yml which crashed plugin onEnable.

Description

  • Added a defensive check in FileManager#getAllGroupData to return an empty map when groups is not a configuration section.
  • Added a defensive check in FileManager#getAllCustomArgData to return an empty map when custom-args is not present.
  • Skip individual custom-args.<id> entries that lack a .args subsection instead of attempting to iterate a null section.

Testing

  • Ran ./gradlew test which failed immediately in this environment due to the local Java/Gradle runtime mismatch rather than the code changes.
  • Ran ./gradlew --version which succeeded and confirmed the Gradle environment information.

Codex Task

### Motivation - Prevent a startup `NullPointerException` caused by dereferencing missing YAML sections in `args.yml` or `config.yml` which crashed plugin `onEnable`. ### Description - Added a defensive check in `FileManager#getAllGroupData` to return an empty map when `groups` is not a configuration section. - Added a defensive check in `FileManager#getAllCustomArgData` to return an empty map when `custom-args` is not present. - Skip individual `custom-args.<id>` entries that lack a `.args` subsection instead of attempting to iterate a null section. ### Testing - Ran `./gradlew test` which failed immediately in this environment due to the local Java/Gradle runtime mismatch rather than the code changes. - Ran `./gradlew --version` which succeeded and confirmed the Gradle environment information. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69c2adbe06f4832fbb17966b6d2bbfb5)

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.