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

[Run-Plugin][Windows Search] Don't crash if URI can't be parsed #11788

Merged
merged 1 commit into from
Jun 18, 2021

Conversation

mykhailopylyp
Copy link
Contributor

@mykhailopylyp mykhailopylyp commented Jun 17, 2021

Summary of the Pull Request

What is this about:
If URI parsing fails we fail to get any results from the Windows search plugin.

What is include in the PR:
If parsing of the URI fails log warning and skip the item.

How does someone test / validate:

Quality Checklist

Contributor License Agreement (CLA)

A CLA must be signed. If not, go over here and sign the CLA.

@mykhailopylyp mykhailopylyp added the Run-Plugin Things that relate with PowerToys Run's plugin interface label Jun 17, 2021
@@ -49,7 +50,12 @@ public List<SearchResult> ExecuteQuery(ISearchQueryHelper queryHelper, string ke
// # is URI syntax for the fragment component, need to be encoded so LocalPath returns complete path
// Using OrdinalIgnoreCase since this is internal and used with symbols
var string_path = ((string)oleDBResult.FieldData[0]).Replace("#", "%23", StringComparison.OrdinalIgnoreCase);
var uri_path = new Uri(string_path);

Copy link
Member

Choose a reason for hiding this comment

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

Do we have a unit test for this. What is a invalid example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't have unit tests for the Microsoft.Plugin.Indexer plugin at all

Copy link
Contributor Author

@mykhailopylyp mykhailopylyp Jun 17, 2021

Choose a reason for hiding this comment

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

What is a invalid example

We don't know the string that can not be parsed for the user. But we log the string if it can not be parsed now.

@mykhailopylyp mykhailopylyp merged commit 735accc into microsoft:master Jun 18, 2021
@mykhailopylyp mykhailopylyp deleted the issue-11506 branch June 18, 2021 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Run-Plugin Things that relate with PowerToys Run's plugin interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants