Skip to content

#1656 nil guards for GraphQL counts in quantity-of-deliverables#1808

Closed
VasilevNStas wants to merge 2 commits into
zerocracy:masterfrom
VasilevNStas:1656-nil-graphql-counts
Closed

#1656 nil guards for GraphQL counts in quantity-of-deliverables#1808
VasilevNStas wants to merge 2 commits into
zerocracy:masterfrom
VasilevNStas:1656-nil-graphql-counts

Conversation

@VasilevNStas

@VasilevNStas VasilevNStas commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Adds || 0 guards on GraphQL json counts (commits, hoc, releases) in quantity-of-deliverables/ judges.

Closes #1656

@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@yegor256 plz review

commits += json['commits']
hoc += json['hoc']
commits += json['commits'] || 0
hoc += json['hoc'] || 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VasilevNStas read about "fail fast" concept

@VasilevNStas

VasilevNStas commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@yegor256

Good point. Removed all || 0 guards — nil now raises naturally (fail fast).
Sorry for the oversight.

@yegor256

yegor256 commented Jul 8, 2026

Copy link
Copy Markdown
Member

@VasilevNStas the PR is empty now

@VasilevNStas

VasilevNStas commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@yegor256

The || 0 nil guards were removed per fail-fast principle (see review). No changes remain — the original code already raises naturally on nil. Closing as resolved.

@0crat

0crat commented Jul 14, 2026

Copy link
Copy Markdown

@yegor256 Thanks for the review! You've earned +9 points for this: +18 as a basis; -5 for very few (1) comments; -4 for too few (0) hits-of-code. Your running score is +611; don't forget to check your Zerocracy account too).

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.

GraphQL responses with nil counts crash 4 quantity/dimensions judges

3 participants