fix: prevent crash on unblessed references in Set::_isdq()#3
Closed
Koan-Bot wants to merge 3 commits intocern-mig:masterfrom
Closed
fix: prevent crash on unblessed references in Set::_isdq()#3Koan-Bot wants to merge 3 commits intocern-mig:masterfrom
Koan-Bot wants to merge 3 commits intocern-mig:masterfrom
Conversation
Fixup pod example
_isdq() called ->isa() on any reference, but unblessed references (plain hashrefs, arrayrefs) cause "Can't call method 'isa' on unblessed reference". Use Scalar::Util::blessed() to check before calling ->isa(), producing the expected "not a Directory::Queue object" error message. Added tests for various non-DQ inputs (hashref, arrayref, scalar ref, plain string).
Author
|
Superseded by #14 — clean branch with only the relevant fix (no fork infrastructure commits). |
Author
|
Superseded by #14 (clean branch from upstream/master, no fork infrastructure noise). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Directory::Queue::Setcrashed with "Can't call method 'isa' on unblessed reference" when passed an unblessed reference (hashref, arrayref, etc.) instead of producing the expected "not a Directory::Queue object" error message.Root cause:
_isdq()usedref($thing) && $thing->isa(...)— butref()returns true for unblessed refs too, and->isa()requires a blessed object.Fix: Use
Scalar::Util::blessed()(core module since Perl 5.8) instead ofref().Changes
Scalar::Util::blessed, use it in_isdq()Test plan
🤖 Generated with Claude Code