-
Notifications
You must be signed in to change notification settings - Fork 24
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
Ignore packages with empty names #5294
base: main
Are you sure you want to change the base?
Ignore packages with empty names #5294
Conversation
@@ -452,6 +452,12 @@ func getPackageFromRegistryKeyItems(children []registry.RegistryKeyItem, platfor | |||
return nil | |||
} | |||
|
|||
if displayName == "" || displayVersion == "" { |
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.
why do we have empty packages in the first place?
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.
From a bit of quick research it seems to be somewhat common (for windows): partial installs, bad uninstalls, or even some software just not putting a DisplayName in the registry during the setup/install process.
I can debug the registry code where we pull display value and then actually check the path that's failing to confirm this.
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 just want to find out if we need to fix something in cnquery. We should mark this as TODO, since generally we should not have empty package names in the first place.
If the package has an empty name skip it. It can cause errors downstream later due to creating invalid PUrls that can't be parsed.
Fixes: #5261.