Repository navigation
[patch] Leave a bot alone when its BotNames entry is null - #67
Merged
Merged
Conversation
RenameFor trimmed every configured value before looking up the bot's own key, so one "Rock": null entry threw for every bot and turned off bot persona tracking. A null target now means the same as a blank one. Fixes #66 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW3f2Szc4ZLoCTbPhuX
|
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.



Fixes #66
What changed
BotNames.RenameForchecked whether a bot's name was already one the map gives by callinggiven.Trim()on every configured value. System.Text.Json reads"BotNames": { "Rock": null }without complaint, so a single null value made every call throw, for every bot. That brokeRenameBot,ConnectBotsandOnPlayerSpawn, so bot persona tracking never started.The check now uses
given?.Trim(). A null target means what a blank one already did: leave that bot alone. Other bots are still renamed.Tests
RenameFor_ANullTarget_StillRenamesTheOtherBots:{ Rock: null, Bob: "Muhlik" }renames Bob to Muhlik.RenameFor_IgnoresANullTarget: the same map leaves Rock alone.NullReferenceExceptionwith the fix reverted. Full suite: 741 passed, 7 skipped (unchanged), 0 failed. Release build has 0 warnings.Generated by Claude Code