Skip to content

Fix sync crash when no advisory is unchanged - #1339

Merged
simi merged 1 commit into
rubysec:masterfrom
Fryguy:fix-sync-compact-nil
Nov 30, 2026
Merged

simi merged 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.
@simi
simi merged commit 8473ac6 into rubysec:master Nov 30, 2026
2 checks passed
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.

2 participants