Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix server crash when executing console commands #5250

Merged
merged 1 commit into from
Jun 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
*/
@ServerEvent
final class CommandEvent implements Event {
public final class CommandEvent implements Event {

private Name commandName;
private List<String> parameters;
Expand All @@ -31,6 +31,6 @@
}

public List<String> getParameters() {
return parameters;

Check warning on line 34 in engine/src/main/java/org/terasology/engine/logic/console/CommandEvent.java

View check run for this annotation

Terasology Jenkins.io / SpotBugs

EI_EXPOSE_REP

LOW: org.terasology.engine.logic.console.CommandEvent.getParameters() may expose internal representation by returning CommandEvent.parameters
Raw output
<p> Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.&nbsp; If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.</p>
}
}
Loading