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 Netkan swinfo transformer null list error #3869

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

HebaruSan
Copy link
Member

Problem

image

KSP-CKAN/KSP2-NetKAN#75

Cause

If a module has no depends relationships, then mod.depends is null here, and .Select doesn't work:

var moduleDeps = mod.depends.Select(r => (r as ModuleRelationshipDescriptor)?.name)
.Where(ident => ident != null)
.ToHashSet();

This problem was masked by all previous mods with swinfo.json files having a dependency on SpaceWarp.

Changes

Now if CkanModule.depends is null, we substitute the empty sequence.

Will self-review so that pull request can proceed.

@HebaruSan HebaruSan added Bug Something is not working as intended Easy This is easy to fix Netkan Issues affecting the netkan data labels Jul 27, 2023
@HebaruSan HebaruSan merged commit e78cf0e into KSP-CKAN:master Jul 27, 2023
10 checks passed
@HebaruSan HebaruSan deleted the fix/swinfo-null-val-err branch July 27, 2023 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Easy This is easy to fix Netkan Issues affecting the netkan data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant