Skip to content

Fix NPE from trailing comma in module.txt dependencies - #175

Open
soloturn wants to merge 1 commit into
developfrom
fix-null-dependency-info
Open

Fix NPE from trailing comma in module.txt dependencies#175
soloturn wants to merge 1 commit into
developfrom
fix-null-dependency-info

Conversation

@soloturn

Copy link
Copy Markdown
Contributor

AI-assisted change proposal.

Gson's lenient parser accepts a trailing comma in the dependencies array but produces a phantom null element in the deserialized list. That null then flowed unfiltered into ModuleMetadata.dependencies and NPE'd in ResolutionAttempt (3 call sites).

Per the issue's own suggestion, fixed at the source in ModuleMetadataJsonAdapter so the list can never contain null, rather than adding null-guards at every consumer.

Closes #133

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 33 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 683135b5-d516-4ce7-915f-fef46e511010

📥 Commits

Reviewing files that changed from the base of the PR and between 8428809 and fb39b3c.

📒 Files selected for processing (2)
  • gestalt-module/src/main/java/org/terasology/gestalt/module/ModuleMetadataJsonAdapter.java
  • gestalt-module/src/test/java/org/terasology/gestalt/module/ModuleMetadataJsonAdapterTest.java

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

NullPointerException when module.txt contains an extra trailing comma

1 participant