fix: add null checks to categorization of plugins in plugin store#4406
Conversation
|
🥷 Code experts: Jack251970 Jack251970 has most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame: ✨ Comment |
|
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs`:
- Around line 49-50: The comparisons using DateTime.Now -
_newPlugin.LatestReleaseDate < TimeSpan.FromDays(7) can be true for future
dates; update the checks in PluginStoreItemViewModel (the logic that sets
RecentlyUpdated/NewRelease based on _newPlugin.LatestReleaseDate) to first
ensure the release date is not in the future (e.g., DateTime.Now >=
_newPlugin.LatestReleaseDate) and then check the age is less than 7 days, so
only dates in the past within the 7-day window mark the plugin as
RecentlyUpdated/NewRelease.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 766247df-44d7-4b7f-96bc-d22b2a48c734
📒 Files selected for processing (1)
Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs
Fix potential null reference issue in plugin store categorization code
Resolves out of scope issue mentioned in #4398
Summary by cubic
Prevents null reference crashes when categorizing plugins in the Plugin Store by adding null checks for release and added dates. Plugins missing these dates now keep the default category instead of throwing.
_newPlugin.LatestReleaseDateand_newPlugin.DateAddedfor null before comparing toDateTime.Now.NullReferenceException.Written for commit faf68c0. Summary will update on new commits.