Skip to content

No UI error on headless server on player death #5251

@jdrueckert

Description

@jdrueckert

What happened

I died in-game and the server logged an error.

How to reproduce

  1. Run a headless server
  2. Join the server
  3. Die
  4. Check the server logs and see the following error logged:
    18:28:18.165 [main] ERROR o.t.e.network.internal.NetClient - Error processing event
    java.lang.NullPointerException: Cannot invoke "org.terasology.engine.rendering.nui.NUIManager.getHUD()" because "this.nuiManager" is null
        at org.terasology.module.inventory.systems.CharacterInventorySystem.resetDropMark(CharacterInventorySystem.java:212)
        at org.terasology.module.inventory.systems.CharacterInventorySystem.onPlayerDeath(CharacterInventorySystem.java:241)
    

Proposed Fix

A headless server shouldn't try to run the respective code path in the first place as it is not expected to have a UI.
If the respective code is relevant for players, this should be run client-side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Size: SSmall effort likely only affecting a single area and requiring little to no researchStatus: Needs InvestigationRequires to be debugged or checked for feasibility, etc.Topic: StabilizationRequests, Issues and Changes related to improving stablity and reducing flakynessType: BugIssues reporting and PRs fixing problems

    Type

    No type

    Projects

    Status

    No status

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions