Fix IdCardConsoleSystem missing prototype error#42884
Open
Tayrtahn wants to merge 1 commit intospace-wizards:masterfrom
Open
Fix IdCardConsoleSystem missing prototype error#42884Tayrtahn wants to merge 1 commit intospace-wizards:masterfrom
IdCardConsoleSystem missing prototype error#42884Tayrtahn wants to merge 1 commit intospace-wizards:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
About the PR
Fixed a prototype indexing error in
IdCardConsoleSystem.Why / Balance
Bug fix. Grafana logs show this error frequently:
Technical details
The error comes from this
PrototypeManager.Resolvecall on line 149:space-station-14/Content.Server/Access/Systems/IdCardConsoleSystem.cs
Lines 149 to 154 in d8b83ba
which sometimes gets an empty string for
newJobProto, which fails to be resolved and logs an error.Why does it sometimes get an empty string? Because of this bit of logic in the UI:
space-station-14/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs
Lines 217 to 226 in 983457c
which explicitly sends an empty string if the value hasn't changed. This makes it so that the job icon and department only get set when a job preset it chosen from the list, instead of every time an access is changed.
While we could add a check for an empty string before the
Resolve, using an empty string to indicate "no change" is a bit clumsy. Instead, the protoid passed in the BUI message is now nullable and uses null to indicate no change.PrototypeManager.Resolvereturns false without logging an error if the passed protoid is null, so there is no longer an issue.Requirements
Breaking changes
IdCardConsoleComponent.WriteToTargetIdMessage.JobPrototypeis now nullable.