Skip to content

Fix Netkan swinfo transformer null list error#3869

Merged
HebaruSan merged 1 commit into
KSP-CKAN:masterfrom
HebaruSan:fix/swinfo-null-val-err
Jul 27, 2023
Merged

Fix Netkan swinfo transformer null list error#3869
HebaruSan merged 1 commit into
KSP-CKAN:masterfrom
HebaruSan:fix/swinfo-null-val-err

Conversation

@HebaruSan
Copy link
Copy Markdown
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
@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