-
-
Notifications
You must be signed in to change notification settings - Fork 452
Fix possible null exception in plugin store item view model #3556
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
Conversation
This comment has been minimized.
This comment has been minimized.
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 Walkthrough""" WalkthroughA null-conditional check was added to the Changes
Assessment against linked issues
Suggested reviewers
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration 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.
Pull Request Overview
This PR adds a null check for ActionKeywords
in the plugin store item view model to prevent a possible null reference exception when building the command query.
- Added a null-conditional check (
?.Any()
) onActionKeywords
- Switched to a lowercase
string
literal for the empty fallback
Comments suppressed due to low confidence (1)
Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs:64
- The code uses
string.empty
, which is not a valid C# member. Usestring.Empty
(capital E) orString.Empty
instead.
var actionKeyword = (PluginManagerData.Metadata.ActionKeywords?.Any() ?? false) ? PluginManagerData.Metadata.ActionKeywords[0] + " " : string.empty;
This comment has been minimized.
This comment has been minimized.
private void ShowCommandQuery(string action) | ||
{ | ||
var actionKeyword = PluginManagerData.Metadata.ActionKeywords.Any() ? PluginManagerData.Metadata.ActionKeywords[0] + " " : String.Empty; | ||
var actionKeyword = (PluginManagerData.Metadata?.ActionKeywords?.Any() == true) ? PluginManagerData.Metadata.ActionKeywords[0] + " " : string.Empty; |
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.
What would cause them to be null?
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.
Metadata: perhaps file is not found or read failed
ActionKeywords: not initialized?
I am also very curious why this could happen, and could you please also check that issue?
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.
Yeah that issue doesn't provide much information we will need to wait for the issuer to reply.
I don't think this is a good fix, it will hide the underlying issue. Logically that shouldn't be null because it's Plugins manager.
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.
Can you check if you can reproduce if you uninstalled the PluginsManager
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.
I think that can cause PluginManagerData
to be null. Let us ask the user first to confirm it.
Pull request was closed
ab1dd2e
to
60de423
Compare
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
🥷 Code experts: no user matched threshold 10 See detailsTo learn more about /:\ gitStream - Visit our Docs |
Resolve #3555.