Skip to content

Fix client NPE in FrequencyControllerManager#getController (Fix for multiplayer crash) - #8601

Open
lunikdev wants to merge 1 commit into
mekanism:26.1from
lunikdev:fix/frequency-controller-client-npe
Open

lunikdev wants to merge 1 commit into
mekanism:26.1from
lunikdev:fix/frequency-controller-client-npe

Conversation

@lunikdev

@lunikdev lunikdev commented Jul 8, 2026

Copy link
Copy Markdown

Frequency controllers are eagerly populated in serverLoad(), which never runs on a pure remote client. Any client-side call that reaches getController() (e.g. BlockMekanism#setPlacedBy -> ISecurityTile#setOwnerUUID placing a machine while connected to a dedicated server) hit a null controller and crashed with an NPE.

createLookup() already had a client-safe, non-persisted fallback for this case (guarded by dataStorage == null), but it was unreachable because getController() returned null before ever reaching it.

Lazily create the controller on demand instead, so every call site is covered rather than special-casing individual callers.

Fixes #8590

Changes proposed in this pull request:

Frequency controllers are eagerly populated in serverLoad(), which
never runs on a pure remote client. Any client-side call that reaches
getController() (e.g. BlockMekanism#setPlacedBy -> ISecurityTile#setOwnerUUID
placing a machine while connected to a dedicated server) hit a null
controller and crashed with an NPE.

createLookup() already had a client-safe, non-persisted fallback for
this case (guarded by dataStorage == null), but it was unreachable
because getController() returned null before ever reaching it.

Lazily create the controller on demand instead, so every call site is
covered rather than special-casing individual callers.

Fixes mekanism#8590
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.

1 participant