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 potential null value issue in MergeDefaultConfig #29

Merged
merged 3 commits into from
Oct 19, 2023
Merged

Conversation

lanyeeee
Copy link
Contributor

I installed SKonsole using the following command

dotnet tool install --global SKonsole

However, when I attempted to check the SKonsole version using skonsole --version, I encountered an issue. The error message I received is as follows:

PS D:\Project> skonsole --version
Unhandled exception. System.TypeInitializationException: The type initializer for 'SKonsole.ConfigurationProvider' threw an exception.
 ---> System.Collections.Generic.KeyNotFoundException: The given key 'OPENAI_CHAT_MODEL_ID' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at SKonsole.ConfigurationProvider.MergeDefaultConfig() in D:\repos\skonsole\apps\SKonsole\ConfigurationProvider.cs:line 41
   at SKonsole.ConfigurationProvider..ctor() in D:\repos\skonsole\apps\SKonsole\ConfigurationProvider.cs:line 27
   at SKonsole.ConfigurationProvider..cctor() in D:\repos\skonsole\apps\SKonsole\ConfigurationProvider.cs:line 9
   --- End of inner exception stack trace ---
   at Program.<Main>$(String[] args) in D:\repos\skonsole\apps\SKonsole\Program.cs:line 9
   at Program.<Main>(String[] args)

To resolve this issue, I cloned the source code, identified the problem, and implemented the necessary fix.
After making the fix, SKonsole worked perfectly.

lanyeeee and others added 3 commits October 19, 2023 16:39
Simplify the assignment of default configuration values by removing
unnecessary conditional checks. This change improves code readability
and reduces complexity.
Copy link
Owner

@lemillermicrosoft lemillermicrosoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM.

@lemillermicrosoft lemillermicrosoft merged commit deed85c into lemillermicrosoft:main Oct 19, 2023
2 checks passed
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.

2 participants