-
-
Notifications
You must be signed in to change notification settings - Fork 85
Fix: Conditionally adds SteamClientComponent #444
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
base: master
Are you sure you want to change the base?
Fix: Conditionally adds SteamClientComponent #444
Conversation
Only adds the SteamClientComponent if the container is not launching real Steam. This change is part of the effort to remove steampipe when using the real Steam client.
📝 WalkthroughWalkthroughModified Changes
Possibly related PRs
Poem
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt`:
- Around line 1836-1839: The code makes SteamClientComponent optional when
container.isLaunchRealSteam is true, but shiftXEnvironmentToContext (and other
callers) still assume it exists and re-adds or accesses it unconditionally;
update shiftXEnvironmentToContext to null-check for SteamClientComponent (and
any other places re-adding or dereferencing it) before using or adding it, e.g.,
retrieve the component via environment.getComponent(SteamClientComponent::class)
and only call environment.addComponent(...) or access its members if the
retrieved value is non-null, handling the absent-case gracefully (skip
adding/using or provide fallback behavior).
|
|
||
| if (!container.isLaunchRealSteam) { | ||
| environment.addComponent(SteamClientComponent()) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard downstream access to SteamClientComponent when real Steam is used.
Line 1836-1839 makes the component optional; shiftXEnvironmentToContext still unconditionally re-adds it (Line 1629), which can become null and crash when the environment is shifted. Add a null-guard there (and any other callers that assume the component exists).
✅ Suggested fix (null-guard in shiftXEnvironmentToContext)
- environment.addComponent(xEnvironment.getComponent<SteamClientComponent>(SteamClientComponent::class.java))
+ xEnvironment.getComponent<SteamClientComponent>(SteamClientComponent::class.java)
+ ?.let { environment.addComponent(it) }🤖 Prompt for AI Agents
In `@app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt` around
lines 1836 - 1839, The code makes SteamClientComponent optional when
container.isLaunchRealSteam is true, but shiftXEnvironmentToContext (and other
callers) still assume it exists and re-adds or accesses it unconditionally;
update shiftXEnvironmentToContext to null-check for SteamClientComponent (and
any other places re-adding or dereferencing it) before using or adding it, e.g.,
retrieve the component via environment.getComponent(SteamClientComponent::class)
and only call environment.addComponent(...) or access its members if the
retrieved value is non-null, handling the absent-case gracefully (skip
adding/using or provide fallback behavior).
Only adds the SteamClientComponent if the container is not launching real Steam.
This change is part of the effort to remove steampipe when using the real Steam client.
Summary by cubic
Conditionally adds SteamClientComponent only when the container is not launching the real Steam client. This supports removing steampipe for real Steam runs and prevents redundant Steam initialization.
Written for commit dd9eb78. Summary will update on new commits.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.