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(search_bucket): set default and check type before using #6151

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Orion-zhen
Copy link

Description

  1. check type of RootElement before calling TryGetProperty
  2. if RootElement is an array, do not try to get version, use default value instead

Changes above should avoid calling TryGetProperty when RootElement is an array.

Motivation and Context

Closes #issue6149

How Has This Been Tested?

I ran my simple test in:

  • Windows version: 11
  • OS architecture: 64bit
  • PowerShell version: 7.4.5

Without my commit, the scoop search shows this:

image

note: the error message will be shown for multiple times, I sent siginit to powershell to avoid too many messages

With my commit, the scoop search shows this:

image

no error messages are shown

Displayed in one picture:

image

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

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.

1 participant