Skip to content

Fix maxJailedUnjail method when town has no jailed residents#8141

Merged
LlmDl merged 1 commit intoTownyAdvanced:masterfrom
Dionert:fix/jail-empty-list-crash
Apr 1, 2026
Merged

Fix maxJailedUnjail method when town has no jailed residents#8141
LlmDl merged 1 commit intoTownyAdvanced:masterfrom
Dionert:fix/jail-empty-list-crash

Conversation

@Dionert
Copy link
Copy Markdown
Contributor

@Dionert Dionert commented Mar 16, 2026

Description:

When a town has no jailed residents, .get() on an empty Optional throws a NoSuchElementException. Added an isEmpty() check to fix this.


New Nodes/Commands/ConfigOptions: -


Relevant Towny Issue ticket: -


  • I have tested this pull request for defects on a server.

By making this pull request, I represent that I have the right to waive copyright and related rights to my contribution, and agree that all copyright and related rights in my contributions are waived, and I acknowledge that the TownyAdvanced organization has the copyright to use and modify my contribution under the Towny License for perpetuity.

When a town has no jailed residents, .get() on an empty Optional throws a NoSuchElementException. Added an isEmpty() check to fix this.
@LlmDl LlmDl modified the milestone: 0.103.0.0 Mar 19, 2026
@LlmDl LlmDl merged commit b85e128 into TownyAdvanced:master Apr 1, 2026
1 check passed
LlmDl added a commit that referenced this pull request Apr 1, 2026
PR #8129.
  - Fix maxJailedUnjail method when town has no jailed residents,
courtesy of Dionert with PR #8141. (First-Time Contributor!)
  - Add maximum deposit and withdraw settings for towns and nations.
    - Closes #8046.
  - New Config Option: economy.banks.town_max_deposit
    - Default: -1
    - When greater than -1, the maximum amount of money players are
allowed to deposit in town bank at a time.
  - New Config Option: economy.banks.town_max_withdraw
    - Default: -1
    - When greater than -1, the maximum amount of money players are
allowed to withdraw from town bank at a time.
  - New Config Option: economy.banks.nation_max_deposit
    - Default: -1
    - When greater than -1, the maximum amount of money players are
allowed to deposit in nation bank at a time.
  - New Config Option: economy.banks.nation_max_withdraw
    - Default: -1
    - When greater than -1, the maximum amount of money players are
allowed to withdraw from nation bank at a time.
  - Send dangerous action confirmation messages in red instead of gray,
courtesy of Veyronity with PR #8145.
  - Remove enderchests from default switch_ids config, courtesy of
Warrior with PR #8147.
  - Fix /towny prices missing the max tax percent caps when a town or
nation has taxpercent in use.
  - Bump org.apache.logging.log4j:log4j-core from 2.25.3 to 2.25.4.
  - Bump io.github.git-commit-id:git-commit-id-maven-plugin from 9.0.2
to 9.1.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants