Skip to content

Crash: PoseStack.getLast() throws NoSuchElementException when WATUT renders with an empty PoseStack #110

@AshrielV

Description

@AshrielV

Describe the bug
WATUT’s RenderHelper.renderWithTooltipEnd assumes that the PoseStack always contains at least one entry. In environments where other mods modify or pop the PoseStack earlier in the render pipeline, this results in a client crash:

java.util.NoSuchElementException at java.util.ArrayDeque.getLast(ArrayDeque.java:413) at com.mojang.blaze3d.vertex.PoseStack.getLast(PoseStack.java:70) at com.corosus.watut.client.screen.RenderHelper.renderWithTooltipEnd(RenderHelper.java:316)

full crash report

Expected behavior
WATUT should safely check whether the PoseStack is empty before calling getLast() or performing operations that assume a non‑empty stack.
Instead, if the PoseStack has been fully popped by another mod’s GUI mixin, WATUT attempts to access the last matrix entry and crashes the client.

Mod and Minecraft version:

  • Version: watut-forge-1.20.1-1.2.3

Additional context
I can't tell you what triggered this, I can only tell you that putting a null guard on poseStack should prevent this kind of rare exception to come up in the future. It seems to happen spontaneously when hitting 'TAB' to expand the player list on my heavily modified, massive pack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions