Skip to content

fix: add null checks to categorization of plugins in plugin store#4406

Merged
Jack251970 merged 1 commit intoFlow-Launcher:devfrom
DavidGBrett:fix--add-null-checks-to-categorization-of-plugins-in-plugin-store
Apr 11, 2026
Merged

fix: add null checks to categorization of plugins in plugin store#4406
Jack251970 merged 1 commit intoFlow-Launcher:devfrom
DavidGBrett:fix--add-null-checks-to-categorization-of-plugins-in-plugin-store

Conversation

@DavidGBrett
Copy link
Copy Markdown
Contributor

@DavidGBrett DavidGBrett commented Apr 10, 2026

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.

  • Summary of changes
    • Changed: Categorization checks _newPlugin.LatestReleaseDate and _newPlugin.DateAdded for null before comparing to DateTime.Now.
    • Added: Safe early exit from category updates when dates are null, preserving the default category.
    • Removed: Direct date subtraction without null checks that could throw NullReferenceException.
    • Memory impact: None.
    • Security risks: None.
    • Tests: No new unit tests added. Manual check confirms plugins with null dates no longer throw and remain uncategorized.

Written for commit faf68c0. Summary will update on new commits.

@prlabeler prlabeler bot added the bug Something isn't working label Apr 10, 2026
@github-actions github-actions bot added this to the 2.2.0 milestone Apr 10, 2026
@gitstream-cm
Copy link
Copy Markdown

gitstream-cm bot commented Apr 10, 2026

🥷 Code experts: Jack251970

Jack251970 has most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs

Activity based on git-commit:

Jack251970
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 94%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@gitstream-cm
Copy link
Copy Markdown

gitstream-cm bot commented Apr 10, 2026

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

📝 Walkthrough

Walkthrough

The DefaultCategory property in PluginStoreItemViewModel now includes null guards for _newPlugin.LatestReleaseDate and _newPlugin.DateAdded before performing datetime calculations, preventing potential null reference exceptions during category determination.

Changes

Cohort / File(s) Summary
Null Safety Enhancement
Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs
Added null checks for _newPlugin.LatestReleaseDate and _newPlugin.DateAdded before datetime arithmetic to prevent runtime exceptions when comparing against the 7-day threshold in category selection logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • jjw24
  • VictoriousRaptor
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description is directly related to the changeset, providing context about the null reference issue being fixed and how the change prevents crashes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: adding null checks to plugin categorization logic in the plugin store to prevent null reference exceptions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7fdf3a2 and faf68c0.

📒 Files selected for processing (1)
  • Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs

@DavidGBrett DavidGBrett marked this pull request as draft April 10, 2026 20:42
@DavidGBrett DavidGBrett changed the title fix: add null checks to categorization of plugins in plugin store Improve plugin store plugin categorization code Apr 10, 2026
@DavidGBrett DavidGBrett changed the title Improve plugin store plugin categorization code fix: add null checks to categorization of plugins in plugin store Apr 10, 2026
@DavidGBrett DavidGBrett marked this pull request as ready for review April 10, 2026 20:51
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@Jack251970 Jack251970 added Dev branch only An issue or fix for the Dev branch build and removed bug Something isn't working labels Apr 11, 2026
Copy link
Copy Markdown
Member

@Jack251970 Jack251970 left a comment

Choose a reason for hiding this comment

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

Thanks for your fix!

@Jack251970 Jack251970 merged commit 2e7a7f8 into Flow-Launcher:dev Apr 11, 2026
10 checks passed
@DavidGBrett DavidGBrett deleted the fix--add-null-checks-to-categorization-of-plugins-in-plugin-store branch April 11, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dev branch only An issue or fix for the Dev branch build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants