Skip to content

Conversation

@Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Jan 1, 2026

Fixes #21348

Let's use #present? instead of negating #empty? to in case we call these on nil. [].present? and {}.present? return false, which gives us the same result.

Copilot AI review requested due to automatic review settings January 1, 2026 18:49
@Rylan12 Rylan12 enabled auto-merge January 1, 2026 18:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves nil-safety in the CaskStruct API code by replacing a negated empty? check with present?, making it consistent with the surrounding code and safer when dealing with potentially nil values.

  • Changes one line to use present? instead of !empty? for checking depends_on_args presence
  • Ensures consistency with all other predicate assignments in the same code block
  • Adds nil-safety protection in case hash["depends_on_args"] is unexpectedly nil

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Rylan12 Rylan12 added this pull request to the merge queue Jan 2, 2026
Merged via the queue into main with commit 9163f84 Jan 2, 2026
43 checks passed
@Rylan12 Rylan12 deleted the fix-cask-struct-again branch January 2, 2026 06:01
@MikeMcQuaid
Copy link
Member

Thanks @Rylan12!

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.

Error: undefined method 'empty?' for nil

4 participants