Skip to content

Fix sync crash when no advisory is unchanged - #1339

Open
Fryguy wants to merge 1 commit into
rubysec:masterfrom
Fryguy:fix-sync-compact-nil
Open

Fryguy wants to merge 1 commit into
rubysec:masterfrom
Fryguy:fix-sync-compact-nil

Conversation

@Fryguy

@Fryguy Fryguy commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Array#compact! returns nil when it removes nothing, so GitHubAdvisorySync.sync raised NoMethodError on files_written.empty? whenever every advisory wrote a file (e.g. a single new advisory with a gem_name filter) or GitHub returned no advisories at all.

Use compact and add specs for these cases.

Array#compact! returns nil when it removes nothing, so
GitHubAdvisorySync.sync raised NoMethodError on files_written.empty?
whenever every advisory wrote a file (e.g. a single new advisory with a
gem_name filter) or GitHub returned no advisories at all.

Use compact and add specs for these cases.
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